i create a hash from an description field to find equal entries.
Now i want to show only the entries with an equal hash.
(Hash value is stored in text_hash field on the model)
I try :group => ‘text_hash’ but i dont figure out the where condition.
(Where Count(*) > 2 something like this… )
but how to :order, :order => ‘text_hash DESC’ seems not to work :-/
Perhaps i have to sort the result collection…
Stephan M. wrote:
Hey all,
i create a hash from an description field to find equal entries.
Now i want to show only the entries with an equal hash.
(Hash value is stored in text_hash field on the model)
I try :group => ‘text_hash’ but i dont figure out the where condition.
(Where Count(*) > 2 something like this… )
Can this be done with minimum?
you need a ‘having’ clause to filter on an aggregate function such as
count. rails 2.3 allows you to pass :having => ‘…’ with old versions
you need to do mucky stuff like :group => ‘text_hash having something
2’