0
我有以下named_scope:幫助重構named_scope
named_scope :commentors, lambda { |*args|
{ :select => 'users.*, count(*) as total_comments',
:joins => :comments,
:conditions => { :comments => { :public_comment => 1, :aasm_state => 'posted', :chalkboard_user_id => nil} },
:group => 'users.id',
:having => ['count(*) > ?', args.first || 0],
:order => 'count(*) desc' }
}
我需要重構的條件如下:
["(public_comment = ? and box IS NOT NULL and can IS NOT NULL and aasm_state != ?", true, 'removed')]
我並沒有與語法更改條件的運氣。有人可以提供協助嗎?
你得到的錯誤是什麼? – 2010-07-09 23:49:05
沒有具體錯誤。只要確保如何去... – keruilin 2010-07-10 00:06:18