Rail plugin acts_as_taggable_on :through
- by Craig
I have two models:
class Employee < ActiveRecord::Base
has_many :projects
end
class Project < ActiveRecord::Base
acts_as_taggable_on :skills, :roles
end
I would like to find Employees using the tags associated with their projects. The geokit-rails plugin supports a similar concept, using its ':through' relationship.
Ideally, I would be able to:
specify which tags (i.e. skills, roles) would be included in the conditions
order the employees by the total number of projects with matching tags
be able to access the matching-tag count for each employee for the purposes of building a tag cloud
Any thoughts would be appreciated.