On 03/03/07, 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 validation errors. Such as automatic > functions that update a flag or increment a counter at billing. These > functions should not fail just because the object is invalid for > whatever reason. > > If you want the same functionality with validation, you can use > update_attributes :attribute => value. > > If this is confusion, please do add a documentation patch explaining > it fully.
Confusion probably arises because both methods have such similar names. Perhaps update and update_without_validation, both taking a hash of attributes, would make a clearer API? I appreciate that the way rails is written, implementing this could be more complicated than a simple rename method, but if it makes ActiveRecord easier to use it could be worth it. Tom --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
