From 1ca2309a4d52acc63c47591df37bceb18780f6aa Mon Sep 17 00:00:00 2001 From: Mike Hall Date: Thu, 26 Jun 2014 15:59:48 -0500 Subject: [PATCH] Revert "Revert "Fix job location updates"" --- app/models/opportunity.rb | 2 +- app/views/opportunities/_form.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/opportunity.rb b/app/models/opportunity.rb index 5697e379..7971dfcb 100644 --- a/app/models/opportunity.rb +++ b/app/models/opportunity.rb @@ -310,7 +310,7 @@ def set_location_city begin locations = self.team.cities.compact.select { |city| self.location.include?(city) } end while locations.blank? && add_opportunity_locations_to_team && set_location_city - self.team.cities.join("|") + locations.join("|") end unless self.location.nil? errors.add(:location, "is not valid, please specify one or more cities separated by | (e.g. Miami, FL | San Francisco). put 'anywhere' if location doesn't matter") if !self.location.nil? and !valid_location_city self.location_city diff --git a/app/views/opportunities/_form.html.haml b/app/views/opportunities/_form.html.haml index 5cdc3036..7f95b20a 100644 --- a/app/views/opportunities/_form.html.haml +++ b/app/views/opportunities/_form.html.haml @@ -19,7 +19,7 @@ -if @team.team_locations.any? =j.label :location do == Select one or more locations where the candidate must be located or #{link_to('add/manage team locations', edit_team_locations_path(@team))} - =j.select(:location, @team.cities+["anywhere"], {:selected => @job.locations}, {:multiple => true}) + =j.select(:location, @team.cities+["anywhere"], {:selected => @job.location.split("|")}, {:multiple => true}) -else =j.label :location, 'Specify the city/location where the candidate must be located' =j.text_field :location