dynamic-finders Questions

13

Solved

I am new to rails. What I see that there are a lot of ways to find a record: find_by_<columnname>(<columnvalue>) find(:first, :conditions => { <columnname> => <columnva...
Kirman asked 22/6, 2012 at 17:58

3

Solved

I'm not sure if I should be updating records this way or if I'm missing something. I have a table with 5 columns (not including timestamps and id) 3 of which are distinct, and 2 which will get upd...

2

Solved

The ActiveRecord find_or_create_by dynamic finder method allows me to specify a block. The documentation isn't clear on this, but it seems that the block only runs in the create case, and not in th...
Orourke asked 28/3, 2011 at 15:30

2

Solved

I have the following code: def maturities InfoItem.find_all_by_work_order(self.work_order).map(&:maturity) end I was thinking about changing it to: def maturities InfoItem.where(work_orde...
Millpond asked 27/6, 2012 at 18:42
1

© 2022 - 2025 — McMap. All rights reserved.