Module: Tagalong::Taggable::InstanceMethods

Defined in:
lib/tagalong/taggable.rb

Instance Method Summary collapse

Instance Method Details

#tagged_with?(name) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/tagalong/taggable.rb', line 18

def tagged_with?(name)
  return self.tagalong_tags.map { |r| r.name }.include?(name)
end

#tagsObject



22
23
24
# File 'lib/tagalong/taggable.rb', line 22

def tags
  return self.tagalong_tags.order("name ASC").map { |r| r.name }
end