djcp / acts_as_freetaggable forked from rkneufeld/acts_as_freetaggable

This URL has Read+Write access

README.mdown

Acts as Freetaggable

NOTE: Still in development, please don't use unless you are helping to develop the plugin.

Acts as Freetaggable (AaF) aims to provide tagging to the models it decorates in a way unlike other tagging plugins provide. Where normal tagging plugins provide tagging in a flat model AaF provides tagging based on a hierarchical model. Take myself as an example:

I belong in the Berkman Institutes hierarchy as an Intern, in a flat model I might be tagged as follows:

(Berkman) (Intern)

or

(Berkman Intern)

Add in (Harvard) as a parent to Berkman and I'd either need to be tagged, again, or have another tag created to represent that hierarchy.

While this is OK for a few people, once you throw in 10s or 100s more tags and tagged objects things can quickly get out of hand. Drilling down a hierarchy objects need only be tagged once, by their deepest association. After this tagging has been made objects are by hierarchy tagged by all parents.

Should I be tagged by the (Harvard → Berkman → Intern)'s (Intern) tag I would then be associated with all of (Intern)'s parents (Harvard) and (Berkman)

Other Features:

  • before_filter updating tag_path
  • children and parents helpers, among others
  • protect against self as parent
  • DB with a solid footing

Using

More once I move to a plugin rather than a rails app for development

Testing

First things first you are going to need a few gems. Hopefully rake gems:install will install them. In addition, if you would like to use autospec or autotest you will need the ZenTest gem.

Once you have the gems required migrate the database -- we are just using sqlite3 so this will suffice:

rake db:migrate

Once you've done that you can run the server with

script/server or script/console

After you know the server will actually run you can run the tests with

script/autospec

I make every attempt to leave every commit passing or pending all tests. Failure is not permitted. As a result if you encounter any errors after a fresh git pull then please message me or log an issue in the github issue tracker for the project