开发者

Why is this not rejecting my records

开发者 https://www.devze.com 2023-01-19 00:42 出处:网络
>> a => [6, 8, 10, 12, 14] >&开发者_JS百科gt; @project.posts(:all, :conditions => [ \"id not in (?)\", a ])
  >> a
  => [6, 8, 10, 12, 14]
  >&开发者_JS百科gt; @project.posts(:all, :conditions => [ "id not in (?)", a ])
  => [#<Post id: 6,........

Why is this not filtering the POst with id of 6


I think you need to use @project.posts.find(:all, :conditions => .....). The method call of just the association itself takes one parameter which indicates whether to reload the association or not.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号