Class: ActsAsTaggable::Tag

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/acts_as_taggable/tag.rb

Instance Method Summary collapse

Instance Method Details

#taggable_classObject



15
16
17
# File 'lib/acts_as_taggable/tag.rb', line 15

def taggable_class
  self.taggable_type.constantize
end

#taggings_cache_keyObject

Returns a cache key that is unique based on the last time the tags were updated or applied



20
21
22
# File 'lib/acts_as_taggable/tag.rb', line 20

def taggings_cache_key
  [name, taggings.maximum(:id), taggings.count]
end

#to_sObject



11
12
13
# File 'lib/acts_as_taggable/tag.rb', line 11

def to_s
  self.name
end