You can find tagged objects using tagged_with
.
class User < ActiveRecord::Base
acts_as_taggable_on :tags, :skills
scope :by_join_date, order("created_at DESC")
end
User.tagged_with("awesome").by_join_date
But how do you find the associations of tagged objects?
class UserAccount < ActiveRecord::Base
belongs_to :user
end
UserAccount.joins(:user)...???
UserAccount.joins(:user).merge(User.tagged_with("awesome"))
Or you can use reverse query:
User.tagged_with("awesome").includes(:user_account).
Query selection depends on your goal.