Class: Tagging

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/is_taggable/tagging.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#contextObject



16
17
18
# File 'lib/is_taggable/tagging.rb', line 16

def context
  self[:context] ? self[:context].to_sym : nil
end

#countObject



24
25
26
# File 'lib/is_taggable/tagging.rb', line 24

def count
  read_attribute(:count).to_i
end

#saveObject



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_sObject



20
21
22
# File 'lib/is_taggable/tagging.rb', line 20

def to_s
  tag
end