Class: Tagging
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Tagging
- Defined in:
- lib/is_taggable/tagging.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#context ⇒ Object
16 17 18 |
# File 'lib/is_taggable/tagging.rb', line 16 def context self[:context] ? self[:context].to_sym : nil end |
#count ⇒ Object
24 25 26 |
# File 'lib/is_taggable/tagging.rb', line 24 def count read_attribute(:count).to_i end |
#save ⇒ Object
28 29 30 |
# File 'lib/is_taggable/tagging.rb', line 28 def save raise "Taggings are protected from being created individually, please use the tagging methods on Taggable objects" end |
#tag=(tag) ⇒ Object
11 12 13 14 |
# File 'lib/is_taggable/tagging.rb', line 11 def tag=(tag) self[:tag] = tag self[:normalized] = TagList.normalize(tag) end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/is_taggable/tagging.rb', line 20 def to_s tag end |