boof / categorizable
- Source
- Commits
- Network (0)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
4cb3793
commit 4cb3793f105e24e07bb97493380a55a93ed73fc7
tree dba2522f7683ae57312a1f4be9844a3c69a42997
parent e8f9b5978caf8d9462303e06a57e8ca45f605e8e
tree dba2522f7683ae57312a1f4be9844a3c69a42997
parent e8f9b5978caf8d9462303e06a57e8ca45f605e8e
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
MIT-LICENSE | ||
| |
README.markdown | ||
| |
Rakefile | ||
| |
generators/ | ||
| |
init.rb | ||
| |
install.rb | ||
| |
install/ | ||
| |
lib/ | ||
| |
test/ | ||
| |
uninstall.rb |
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

