Project

General

Profile

« Previous | Next » 

Revision be33e6e9

Added by Tomer Brisker over 8 years ago

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

View differences:

app/models/taxonomy.rb
(users+User.only_admin).each { |u| u.expire_topbar_cache(sweeper) }
end
# 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.
elements = ids.size == 1 ? [self] : self.class.sort_by_ancestry(self.class.includes("#{type.downcase}_parameters".to_sym).find(ids))
elements.each do |el|
el.send("#{type.downcase}_parameters".to_sym).each {|p| hash[p.name] = include_source ? {:value => p.value, :source => sti_name, :safe_value => p.safe_value, :source_name => el.title} : p.value }
end
hash
end
private
delegate :need_to_be_selected_ids, :selected_ids, :used_and_selected_ids, :mismatches, :missing_ids, :check_for_orphans,

Also available in: Unified diff