Class: RocketTag::Tag

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.by_taggable_type(type) ⇒ Object



9
10
11
# File 'lib/rocket_tag/tag.rb', line 9

def self.by_taggable_type(type)
  joins{taggings}.where{taggings.taggable_type == type.to_s}
end

Instance Method Details

#tags_countObject



13
14
15
# File 'lib/rocket_tag/tag.rb', line 13

def tags_count
  self[:tags_count].to_i
end