Integer("008") != "008".to_i
to_imethod is what you want, unless you want exceptions or octal numbers.
Somebody needed help constructing a
named_scopewhere they could reference the count of an associated
has_manyassociation. There was some grumbling about using
:group(and if you do this, be sure not to call
counton the scope itself without also doing a
:select => 'DISTINCT primary_key'). The winning solution was to just put a counter_cache on the association and use the denormalized column instead.