On 19/06/2007, at 11:47 AM, dasil003 wrote: > * I know I could work around this by refactoring the functionality > into Property and passing the user as a parameter, but that makes my > code both more complicated and more opaque. The User should know what > properties it can access. A Property shouldn't have any concept of > the user.
The Property store should be the one responsible for scoping its own data retrieval. If the User needs to specify conditions then it shouldn't be done w/o the Property datastore's knowledge (with_scope), it should tell the Property data store the conditions it wants applied, and the Property store can use whatever it needs to make that happen (in this case an AR with_scope). See Rick's example for a better separation of responsibilities. -- tim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
