Module: SemanticallyTaggable::Taggable::Cache::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#caching_tag_list_on?(scheme_name) ⇒ Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/semantically_taggable/semantically_taggable/cache.rb', line 35

def caching_tag_list_on?(scheme_name)
  column_names.include?("cached_#{scheme_name.to_s.singularize}_list")
end

#initialize_semantically_taggable_cacheObject



20
21
22
23
24
25
26
27
28
# File 'lib/semantically_taggable/semantically_taggable/cache.rb', line 20

def initialize_semantically_taggable_cache
  scheme_names.map(&:to_s).each do |scheme_name|
    class_eval %(
      def self.caching_#{scheme_name.singularize}_list?
        caching_tag_list_on?("#{scheme_name}")
      end        
    )
  end        
end

#semantically_taggable(*args) ⇒ Object



30
31
32
33
# File 'lib/semantically_taggable/semantically_taggable/cache.rb', line 30

def semantically_taggable(*args)
  super(*args)
  initialize_semantically_taggable_cache
end