Permalink
Browse files

update readme and remove created_at for the time being

  • Loading branch information...
1 parent ee528f2 commit 99819fbeff3ecd8ad3f7f373ab81c150fceac14b @jackdempsey committed Dec 8, 2008
Showing with 43 additions and 5 deletions.
  1. +0 −4 README.markdown
  2. +42 −0 README.rdoc
  3. +1 −1 lib/sequel_taggable/migration.rb
View
4 README.markdown
@@ -1,4 +0,0 @@
-Sequel Taggable
-===============
-
-A simple plugin for Sequel::Model's that lets you work with tags.
View
42 README.rdoc
@@ -0,0 +1,42 @@
+= 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
+
+
+
+
+
+
+
View
2 lib/sequel_taggable/migration.rb
@@ -12,7 +12,7 @@ def up
varchar :taggable_type, :null => false
#varchar :tag_context, :null => false
- datetime :created_at
+ #datetime :created_at #TODO decide on using is_timestamped plugin to autofill this
index [:tag_id, :taggable_id, :taggable_type]
end
end

0 comments on commit 99819fb

Please sign in to comment.