Revision be33e6e9
Added by Tomer Brisker over 8 years ago
app/models/taxonomies/location.rb | ||
---|---|---|
where(conditions)
|
||
}
|
||
|
||
# returns self and parent parameters as a hash
|
||
def parameters(include_source = false)
|
||
hash = {}
|
||
ids = ancestor_ids
|
||
ids << id unless new_record? or self.frozen?
|
||
# need to pull out the locations to ensure they are sorted first,
|
||
# otherwise we might be overwriting the hash in the wrong order.
|
||
locs = ids.size == 1 ? [self] : Location.sort_by_ancestry(Location.includes(:location_parameters).find(ids))
|
||
locs.each do |loc|
|
||
loc.location_parameters.each {|p| hash[p.name] = include_source ? {:value => p.value, :source => N_('location').to_sym, :source_name => loc.title} : p.value }
|
||
end
|
||
hash
|
||
end
|
||
|
||
def dup
|
||
new = super
|
||
new.organizations = organizations
|
Also available in: Unified diff
Fixes #11650 - show global parameter value inherited from parent taxonomy