app/concepts/offer/contracts.rb
# Ensure selected organization is the same as the selected location's
# organization
Ensure selected organization is the same as the selected location's
organization
Ensure selected organization is the same as the selected location ' s organization
def location_fits_organization
      ids = organizations.pluck(:id)
      if personal? && location && location.organization &&
         !ids.include?(location.organization.id)
        errors.add :location, I18n.t(
          'offer.validations.location_fits_organization'
        )
      end
    end
def location_fits_organization ids = organizations . pluck ( :id ) if personal? && location && location . organization && ! ids . include? ( location . organization . id ) errors . add :location , I18n . t ( 'offer.validations.location_fits_organization' ) end end
Ensure selected organization is the same as the selected location's
organization
Ensure selected organization is the same as the selected location ' s organization