Module: Sequel::Plugins::Taggable

Defined in:
lib/sequel_taggable/sequel_taggable.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.apply(model, options = {}) ⇒ Object

Apply the plugin to the model.



5
6
7
8
9
10
11
# File 'lib/sequel_taggable/sequel_taggable.rb', line 5

def self.apply(model, options = {})
  model.class_eval %{
    is :polymorphic
    has_many :taggings, :as => :taggable
    many_to_many :tags, :through => :taggings, :as => :taggable
  }
end