0
您可以使用tagged_with
找到标记的对象。rails:如何基于acts_as_taggable_on关联标签进行查询?
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
但你如何找到标记对象的关联?
class UserAccount < ActiveRecord::Base
belongs_to :user
end
UserAccount.joins(:user)...???