Project

General

Profile

« Previous | Next » 

Revision 5b160515

Added by Tomer Brisker over 8 years ago

Fixes #11650 - show global parameter value inherited from parent taxonomy

(cherry picked from commit be33e6e905c8d0315262a3a3a45459c3a098a29e)

View differences:

app/models/taxonomies/organization.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 organizations to ensure they are sorted first,
# otherwise we might be overwriting the hash in the wrong order.
orgs = ids.size == 1 ? [self] : Organization.sort_by_ancestry(Organization.includes(:organization_parameters).find(ids))
orgs.each do |org|
org.organization_parameters.each {|p| hash[p.name] = include_source ? {:value => p.value, :source => N_('organization').to_sym, :source_name => org.title} : p.value }
end
hash
end
def dup
new = super
new.locations = locations

Also available in: Unified diff