[Rails-core] Re: Confusing behavior with attr_readonly

2009-02-27 Thread Mischa
Hi - To your options at the bottom, I might add: d) silently ignore update_attribute, in the same way that attr_protected silently ignores mass assignment. (to deal with the issue of the obj in memory appearing to be updated) this seems to be most in keeping with the doc: "Attributes listed as

[Rails-core] Re: [PATCH] has_many :through scoped association

2009-02-27 Thread Ryan Bates
-1 on inheritance solution. It is creative, but I imagine that can get messy very quickly if you have multiple attributes you're trying to do this with. As for Luke's solution, I think it is good. But I do wonder if the interface should be different. Before named scopes it was often necessary to

[Rails-core] Re: [PATCH] has_many :through scoped association

2009-02-27 Thread Duncan Beevers
Instead of extracting a specific piece of a named_scope's proxy options, I would probably elect to use a more flexible, object-oriented solution using inheritance. http://gist.github.com/71604 On Fri, Feb 27, 2009 at 9:37 AM, Luke Redpath wrote: > > In my current project, I have an association

[Rails-core] [PATCH] has_many :through scoped association

2009-02-27 Thread Luke Redpath
In my current project, I have an association model that has various flags available. To keep the implementation of these flags encapsulated, I created named_scopes for each flag and use these scopes for finding and creating. This model sits between two others as the join model in a has_many :thro

[Rails-core] Re: Association after_add callback for new records

2009-02-27 Thread Eloy Duran
Hi Kenneth, Could you try if this regression was introduced after this commit: 5cda000bf0f6d85d1a1efedf9fa4d0b6eaf988a1 Cheers, Eloy On 27 feb 2009, at 15:40, Kenneth Kalmer wrote: > Hi everyone > > Please help me to identify the issue here. Either with the code or > the documentation, not

[Rails-core] Association after_add callback for new records

2009-02-27 Thread Kenneth Kalmer
Hi everyone Please help me to identify the issue here. Either with the code or the documentation, not sure where the issue lies at the moment. Code first, then question. I have replicated the issue with this simple test on edge: activerecord/test/cases/associations/callback_test.rb: def test_b