boof / categorizable

Simply categorize (tag) your ActiveRecord models.

This URL has Read+Write access

boof (author)
Tue Dec 16 08:49:03 -0800 2008
commit  4cb3793f105e24e07bb97493380a55a93ed73fc7
tree    dba2522f7683ae57312a1f4be9844a3c69a42997
parent  e8f9b5978caf8d9462303e06a57e8ca45f605e8e
README.markdown

Categorizable

Simply categorize (tag) your ActiveRecord models.

Example

class Item < ActiveRecord::Base
  categorizable
end
item = Item.create :category_names => 'Example Category, Item'

Categorizable::Category.find :all # => [
  #<Categorizable::Category id: 1, name: "Example Category", ...>,
  #<Categorizable::Category id: 2, name: "Item", ...>
]

item.category_names # => 'Example Category, Item'

relative = Item.create :category_names => item.category_names
Item.related_to 'Example Category' # => [item, relative]
item.relatives # => [relative]

Install

$ script/plugin install git://github.org/boof/categorizable

or

$ git submodule add git://github.org/boof/categorizable vendor/plugins/categorizable
$ cd vendor/plugins/categorizable && ruby install.rb

Copyright (c) 2008 Florian Aßmann, released under the MIT license