search for: nb9sxpffzh

Displaying 3 results from an estimated 3 matches for "nb9sxpffzh".

2009 Mar 16
4
Overriding ActiveRecord associations for special cases
Hi, Does anyone know a good way to override AR associations to take special cases into account. My current take is the example below which allows the ''root'' user to access all products, but only works if I remember to call it with a .all/.find or similar method: ''user.products.all'' instead of ''user.products''. Ideally I guess I want to return a
2009 Aug 10
1
Call AR belongs_to association accessor ID method on object assignment
Hi, Haven''t been able to find this raised before but I''m sure it must have been. When assigning an object to a belongs_to association I would like it to call the *association*_id= method instead of directly updating the attributes array. This is because I want to modify the behaviour when assigning a particular object without writing separate methods for whether it''s
2008 Mar 06
0
Searching multiple related models
Hi, I''m interested in some feedback about a solution for searching multiple related models by columns (as opposed to full-text). A brief example would be three models with typical has_many relations: Hotel (name, company) Room (number, type) Bed (type, age) I have a search form that lists the fields for each model with a text input. Upon submission the search needs to find the results