Displaying 1 result from an estimated 1 matches for "find_all_by_category_code".
2005 Dec 16
10
''Code table'' best practices?
...anings.
My customers usually want a metric truckload full of reports. Often,
there are more reports than actual business logic. So much fun.
Reports get much, much easier when you don''t need to join over into a
lookup table constantly.
It would be nice to able able to simply say:
Plans.find_all_by_category_code ''123456''
If I follow the ''pure'' ActiveRecord intent for this, it would instead look like:
Table: PLANS
ID int
CATEGORY_ID int
Table: CATEGORIES
ID int
CATEGORY_CODE char(6)
DESCRIPTION varchar(200)
..and I would then need to do:
Plans.find(:all, :conditions =&...