4 ms·
As an aside, beware using idiomatic ruby while writing ActiveRecord queries. Model.all.inject { sum or average code } will destroy you once you get into produc
by jacques_chester 16y ago
As an aside, beware using idiomatic ruby while writing ActiveRecord queries.
Model.all.inject { sum or average code } will destroy you once you get into production. Working at an otherwise excellent Rails shop I had to launch a mini-jihad to drive this stuff out.
(NB my code is wrong because I haven't written Ruby for a while).