Module: Platanus::TagSetAttr

Defined in:
lib/platanus/tag_set.rb

Overview

tag_set_attr.rb : searchable tag sets.

usage:

class Model
  include Platanus::TagSetAttr

  attr_tagset :demo
end

t = Model.create
t.demo << 'tag1'
t.demo << 'tag2'
t.save!

t.demo # returns ['tag1', 'tag2']

#searching
Model.search_by_demo(all: 'tag1') # returns [t]
Model.search_by_demo(all: 'tag1', none: 'tag2') # returns []

# TODO: provide fulltext search support.

Copyright February 2013, Ignacio Baixas [email protected].

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



28
29
30
# File 'lib/platanus/tag_set.rb', line 28

def self.included(base)
  base.extend ClassMethods
end