【发布时间】:2015-09-10 07:42:54
【问题描述】:
关系:
投票.rb
belongs_to :user
belongs_to :celebrity, counter_cache: true
名人.rb
belongs_to :user
belongs_to :category
has_many :votes
我需要在投票模型中使用类似的条件
belongs_to :celebrity, counter_cache: true, :conditions => ['votes.upvote = ? ', true]
谁能帮帮我
【问题讨论】:
-
嘿,您可以参考此链接了解条件stackoverflow.com/questions/2156514/…
标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-4 ruby-on-rails-3.2