[Rails-core] Form select should d string equality rather than object equality

2009-09-07 Thread Peter Marklund
lect-options-in-forms-symbolstring-indifferent Comments on this? Thanks! Peter Marklund http://marklunds.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post t

[Rails-core] Re: ActiveRecord::Base.exists? incompatibility with :include scopes fixed

2009-04-23 Thread Peter Marklund
> Exists is only really for indicating whether or not there's a record > associated with that ID, if you want to obey all those other rules you > can just use .first(...) right?  I'm -1 on this as it stands as exists I'm not sure what you mean by "all those other rules". The exists? method does t

[Rails-core] ActiveRecord::Base.exists? incompatibility with :include scopes fixed

2009-04-22 Thread Peter Marklund
Hi! I was using a default scope with an :order option as well as an :include option and came across a bug in the ActiveRecord::Base.exists? method. It turns out it drops any :include option from the current scope. My solution is a bit radical maybe, but simple. I have exists? invoke find_initial s

[Rails-core] Re: Stack traces from plugins missing in Rails 2.3?

2009-04-06 Thread Peter Marklund
nightmares similar to mine. I have never been too bothered by long stacktraces Rails, but I suppose since this feature was introduced, a lot of people have. Cheers Peter On Apr 3, 10:01 am, Peter Marklund wrote: > Hi! > Has anyone experienced that stack traces are missing when exceptions > a

[Rails-core] Stack traces from plugins missing in Rails 2.3?

2009-04-03 Thread Peter Marklund
interfering with the the stack trace? Any pointers would be appreciated. Thanks! Peter Marklund http://marklunds.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to

[Rails-core] TestRequest#recycle! and clearing out params between subsequent posts in tests

2009-03-17 Thread Peter Marklund
: http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2271-reset-request_params-in-testrequestrecycle#ticket-2271-1 I am not familiar enough with Rack and Rails internals to judge if my solution is appropriate but it works. Thanks! Peter Marklund http://marklunds.com

[Rails-core] Re: Using mixins versus delegation

2007-05-02 Thread Peter Marklund
On May 2, 2:11 am, DHH <[EMAIL PROTECTED]> wrote: > Delegation is preferred when you don't need to extend the base > functionality. Like validations extends save in AR. See CookieJar in > AP as an example of delegation. That sounds reasonable David. Thanks for clarifying. Peter --~--~-

[Rails-core] Using mixins versus delegation

2007-05-01 Thread Peter Marklund
I've been working on a plugin called Http Test where I add HTML validation and link checking to controller and integration tests through an after filter in ApplicationController. I used to mix in a bunch of methods that I needed into the ApplicationController class, but to me this had a bad smell,

[Rails-core] Re: Why, again, is it ActiveRecord::Base#update_attribute doesn't trigger validations?

2007-03-06 Thread Peter Marklund
I said earlier that I understood the use case that made update_attribute be non-validating, but as I've thought about this more I'm not so sure anymore. My interpretation of what you are saying is that you have data in your database that doesn't validate, and you don't want your flag updating scri

[Rails-core] Re: Why, again, is it ActiveRecord::Base#update_attribute doesn't trigger validations?

2007-03-05 Thread Peter Marklund
On Mar 4, 8:35 pm, Jamis Buck <[EMAIL PROTECTED]> wrote: > Lots of people are depending on the current behavior. The method > wasn't added arbitrarily, or in a fit of spite, it was extracted from > real use, just like the rest of Rails. I use it all the time as a > "update this flag in spite of th

[Rails-core] Re: Why, again, is it ActiveRecord::Base#update_attribute doesn't trigger validations?

2007-03-04 Thread Peter Marklund
On Mar 3, 11:29 am, "DHH" <[EMAIL PROTECTED]> wrote: > > I was hoping someone could take the time to explain to me why > > update_attribute doesn't trigger validations? Why am I concerned with this? > > Because it's intended to be used in scenarios where you're not > interested in dealing with val

[Rails-core] Why, again, is it ActiveRecord::Base#update_attribute doesn't trigger validations?

2007-03-03 Thread Peter Marklund
Hi! I was hoping someone could take the time to explain to me why update_attribute doesn't trigger validations? Why am I concerned with this? 1) It's inconsistent with the behaviour of the update_attributes method 2) People may think (like me) that all public methods that update ActiveRecord objec