A Tag plugin for Sequel::Model's
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
LICENSE
README.rdoc
Rakefile
TODO
sequel_taggable.gemspec

README.rdoc

Sequel::Taggable

A simple plugin for Sequel::Model's that lets you work with tags. To use simply declare “is :taggable” in your model.

Example

For easy cut & paste testing, here's a setup for an irb session. You can find the same schema Sequel::Taggable uses in sequel_taggable/migration.rb

require 'rubygems' require 'sequel'

DB = Sequel.sqlite

require 'sequel_taggable/migration'

CreateTags.apply(DB, :up)

class Article < Sequel::Model

set_schema do
  primary_key :id
  varchar :name
end

is :taggable

end

Article.create_table

a = Article.create(:name => “Example article”)

t = Tag.create(:name => “tag one”)

a.add_tag(t)

pp Tagging.all