I’m trying to do a find with a particular condition.
I have a runs table with a n_passed_steps column and an n_failed_steps
I’m trying to do a find, to find all records, limited to the last 10,
ordered by descending id, but with a pass percentage rate greater than
So i’ve got the :all, :limit => 10, :order => ‘id DESC’ bit, it’s just
the :conditions bit I’m struggling with.
The calculation is ((n_passed_steps/(n_passed_steps + n_failed_steps)) *
100) > 50 but if I simply insert that after :conditions, whether it be
in ‘quotes’ or [square brackets] I get an error.
What is the correct way to go about this?