[LRUG] Controlling the order in which update_attributes processes the attributes
John Winters
john at sinodun.org.uk
Sat Aug 18 03:05:49 PDT 2007
Tom Stuart wrote:
> On 18 Aug 2007, at 08:57, John Winters wrote:
>> Is there any way of controlling the order in which update_attributes
>> processes the attributes in a browser request?
>
> update_attributes takes a hash argument, so the keys will be in an
> arbitrary ("random") order. It's unlikely that you really want to
> override it -- perhaps you want to use a callback (http://
> api.rubyonrails.org/classes/ActiveRecord/Callbacks.html) to perform
> your post-processing of the attribute values?
Thank you - as ever it's just a question of learning the right way to
think about it.
Cheers,
John
More information about the Chat
mailing list