module Alchemy::Taggable

ActsAsTaggableOn to Gutentag interface compatibility module Include this module to add tagging support to your model.

Public Class Methods

included(base) click to toggle source
# File lib/alchemy/taggable.rb, line 7
def self.included(base)
  Gutentag::ActiveRecord.call base
  base.extend ClassMethods
  base.send(:alias_method, :tag_list, :tag_names)
end

Public Instance Methods

tag_list=(tags) click to toggle source

Set a list of tags Pass a String with comma separated tag names or an Array of tag names

# File lib/alchemy/taggable.rb, line 16
def tag_list=(tags)
  case tags
  when String
    self.tag_names = tags.split(/,\s*/)
  when Array
    self.tag_names = tags
  end
end