我有以下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')]
我对更改条件的语法不太满意。有人可以提供帮助吗?