Module: TagRingtail::ActiveRecord

Defined in:
lib/tag_ringtail/active_record.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



2
3
4
5
# File 'lib/tag_ringtail/active_record.rb', line 2

def self.included(base)
  # include our class methods
  base.extend TagRingtail::ActiveRecord::ClassMethods
end

Instance Method Details

#tag_namesObject



7
8
9
# File 'lib/tag_ringtail/active_record.rb', line 7

def tag_names
  @tag_names ||= TagRingtail::TagNames.new self
end

#tag_names=(names) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/tag_ringtail/active_record.rb', line 11

def tag_names=(names)
  if names.is_a?(TagRingtail::TagNames)
    @tag_names = names
  else
    # convert the array of strings to a TagNames object
    @tag_names = TagRingtail::TagNames.new_with_names self, names
  end
end