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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to