【发布时间】:2017-08-31 10:01:53
【问题描述】:
您可以使用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
但是如何找到标记对象的关联?
class UserAccount < ActiveRecord::Base
belongs_to :user
end
UserAccount.joins(:user)...???
【问题讨论】:
标签: ruby-on-rails activerecord acts-as-taggable-on