Hi,
Modify your query to
loyalties = Transaction.count(:loyalty_id , :joins=> :loyalties,
:conditions => ["loyalties.created_at > ? ",cdate], :group=>
["transactions.loyalty_id"], :having=> ["count(*) > 1 "]
loyalties contain OrderedHash. Now do loyalties.count to get actual
count of filtered loyalties and that matches with your raw sql output.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment