Merge location data in events
This commit is contained in:
parent
58a5b4b7d5
commit
73ece643ca
2 changed files with 14 additions and 0 deletions
13
lib/location.rb
Normal file
13
lib/location.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
def merge_item_location_data(location)
|
||||
if (location && location[:location])
|
||||
templates = @items['/_data/locations/'].attributes
|
||||
if templates[location[:location].to_sym]
|
||||
location.merge!(templates[location[:location].to_sym])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def merge_location_data()
|
||||
items.select { |i| i[:kind] == 'event' }.each { |e| merge_item_location_data(e[:location]) }
|
||||
end
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue