Skip to content

Commit 039aae1

Browse files
committed
Merge pull request coderwall#27 from assemblymade/revert-21-revert-10-location-fix
Revert "Revert "Fix job location updates""
2 parents 8458d57 + 1ca2309 commit 039aae1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/models/opportunity.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def set_location_city
310310
begin
311311
locations = self.team.cities.compact.select { |city| self.location.include?(city) }
312312
end while locations.blank? && add_opportunity_locations_to_team && set_location_city
313-
self.team.cities.join("|")
313+
locations.join("|")
314314
end unless self.location.nil?
315315
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
316316
self.location_city

app/views/opportunities/_form.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
-if @team.team_locations.any?
2020
=j.label :location do
2121
== Select one or more locations where the candidate must be located or #{link_to('add/manage team locations', edit_team_locations_path(@team))}
22-
=j.select(:location, @team.cities+["anywhere"], {:selected => @job.locations}, {:multiple => true})
22+
=j.select(:location, @team.cities+["anywhere"], {:selected => @job.location.split("|")}, {:multiple => true})
2323
-else
2424
=j.label :location, 'Specify the city/location where the candidate must be located'
2525
=j.text_field :location

0 commit comments

Comments
 (0)