search for: viewable_sql

Displaying 1 result from an estimated 1 matches for "viewable_sql".

2006 Jan 09
3
Selecting a subset of a table with DRY
...viewable(...) and Category.find(...).viewable_listings, but I see no way to do this without violating DRY in several places, or stepping all over AR''s toes. My idea was to define a method in application.rb which returns the appropriate SQL string that makes a listing viewable, call it viewable_sql, and then put that where appropriate. However, I''d like find_viewable to work just like find, except that it would modify the parameters to find to incorporate those conditions. Any thoughts or examples of something similar? Thanks. -- Jesse Farmer <farmerje@uchicago.edu> Univ...