Module: ActsAsTaggableOn::Taggable::Cache::InstanceMethods

Defined in:
lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb

Instance Method Summary collapse

Instance Method Details

#save_cached_tag_listObject



68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb', line 68

def save_cached_tag_list
  tag_types.map(&:to_s).each do |tag_type|
    if self.class.send("caching_#{tag_type.singularize}_list?")
      if tag_list_cache_set_on(tag_type)
        list = tag_list_cache_on(tag_type).to_a.flatten.compact.join(', ')
        self["cached_#{tag_type.singularize}_list"] = list
      end
    end
  end

  true
end