有人可以告诉我在Rails 4中执行以下行的等效方法是什么吗?
has_many :friends, :through => :friendships, :conditions => "status = 'accepted'", :order => :first_name
我尝试了以下方法:
has_many :friends, -> { where status: 'accepted' }, :through => :friendships , :order => :first_name
但是我收到以下错误:
Invalid mix of scope block and deprecated finder options on ActiveRecord association: User.has_many :friends