# File lib/acts_as_taggable_on/acts_as_taggable_on/ownership.rb, line 50 def cached_owned_tag_list_on(context) variable_name = "@owned_#{context}_list" cache = (instance_variable_defined?(variable_name) && instance_variable_get(variable_name)) || instance_variable_set(variable_name, {}) end
# File lib/acts_as_taggable_on/acts_as_taggable_on/ownership.rb, line 55 def owner_tag_list_on(owner, context) add_custom_context(context) cache = cached_owned_tag_list_on(context) cache[owner] ||= ActsAsTaggableOn::TagList.new(*owner_tags_on(owner, context).map(&:name)) end
# File lib/acts_as_taggable_on/acts_as_taggable_on/ownership.rb, line 71 def reload(*args) self.class.tag_types.each do |context| instance_variable_set("@owned_#{context}_list", nil) end super(*args) end
# File lib/acts_as_taggable_on/acts_as_taggable_on/ownership.rb, line 63 def set_owner_tag_list_on(owner, context, new_list) add_custom_context(context) cache = cached_owned_tag_list_on(context) cache[owner] = ActsAsTaggableOn::TagList.from(new_list) end
Generated with the Darkfish Rdoc Generator 2.