app/helpers/admin/editions_helper.rb
# Because of the unusual way lead organisations and supporting organisations
# are managed through the single has_many through :organisations association,
# We have to go through the join model to identify selected organisations
# when rendering editions' organisation select fields. See the
# Edition::Organisations mixin module to see why this is required.
Because of the unusual way lead organisations and supporting organisations
are managed through the single has_many through :organisations association,
We have to go through the join model to identify selected organisations
when rendering editions' organisation select fields. See the
Edition::Organisations mixin module to see why this is required.
Because of the unusual way lead organisations and supporting organisations are managed through the single has_many through : organisations association We have to go through the join model to identify selected organisations when rendering editions ' organisation select fields . See the Edition :: Organisations mixin module to see why this is required .
def lead_organisation_id_at_index(edition, index)
    edition.edition_organisations
            .select(&:lead?)
            .sort_by(&:lead_ordering)[index].try(:organisation_id)
  end
def lead_organisation_id_at_index ( edition , index ) edition . edition_organisations . select ( & :lead? ) . sort_by ( & :lead_ordering ) [ index ] . try ( :organisation_id ) end
Because of the unusual way lead organisations and supporting organisations
are managed through the single has_many through :organisations association,
We have to go through the join model to identify selected organisations
when rendering editions' organisation select fields.
Because of the unusual way lead organisations and supporting organisations are managed through the single has_many through : organisations association We have to go through the join model to identify selected organisations when rendering editions ' organisation select fields .
edition
index