Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Tag plugin for Sequel::Model's

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 TODO
Octocat-spinner-32 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

Something went wrong with that request. Please try again.