mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Fix name fetcher
This commit is contained in:
parent
6b96e1f0be
commit
43bc8c444c
1 changed files with 9 additions and 7 deletions
|
|
@ -15,16 +15,18 @@ module Places
|
|||
return if properties.blank?
|
||||
|
||||
ActiveRecord::Base.transaction do
|
||||
@place.name = properties['name']
|
||||
@place.city = properties['city']
|
||||
@place.country = properties['country']
|
||||
@place.name = properties['name'] if properties['name'].present?
|
||||
@place.city = properties['city'] if properties['city'].present?
|
||||
@place.country = properties['country'] if properties['country'].present?
|
||||
@place.geodata = geodata.data if DawarichSettings.store_geodata?
|
||||
@place.save!
|
||||
|
||||
@place
|
||||
.visits
|
||||
.where(name: Place::DEFAULT_NAME)
|
||||
.update_all(name: properties['name'])
|
||||
if properties['name'].present?
|
||||
@place
|
||||
.visits
|
||||
.where(name: Place::DEFAULT_NAME)
|
||||
.update_all(name: properties['name'])
|
||||
end
|
||||
|
||||
@place
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue