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