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

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

Instance Method Summary collapse

Instance Method Details

#save_cached_tag_listObject


76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/acts_as_taggable_on/taggable/cache.rb', line 76

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("#{ActsAsTaggableOn.delimiter} ")
        self["cached_#{tag_type.singularize}_list"] = list
      end
    end
  end

  true
end