search for: _customer

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

Did you mean: customer
2007 Nov 26
6
Model setters, override attribute=(attribute)?
...set customer to nil. Likewise, if I set customer, it should inspect the customer_type attached to the customer and set accordingly within Basket. However implementing it as below doesn''t seem to work. Am I missing a better way to achieve this? I had also considered using a before_save :set_customer_type kind of thing but felt the code may loose a little readability. I''m coming from a Java world with protected attributes, accessed via domain influence methods, .set_customer, .process_order etc... I wasn''t really sure how best to interpret this into ruby on rails models. clas...