>Mark Reginald James wrote:
>> Michael Kahle wrote:
>> Another good thought, however what I am using now doesn't have the same 
>> duplication as your suggested code does.  Unless of course when I call 
>> the "attributes" method it runs a check then as well.  I'm not sure that 
>> is the case.  I'll have to think about that.
> 
> It's the validation code that's run twice, once at valid? and
> once at save!, which you'll see if you put a logger.debug call
> in say a Customer.validate method.
> 
> This usually doesn't cause problems, only unnecessary extra
> CPU load.

Ok.  I'm confused.  If I step through my code line by line it would seem 
to me that it does the following:

1.) Creates a new object to dump stuff into.
2.) Dumps everything from the form (params) into these new objects.
3.) Begins the transaction.
4.) First updates @snowplow_registration, the ! at the end of the update 
method forces a check against the model for validation and returns any 
errors that come from the update.  If it doesn't succeed, then it is 
caught by the rescue case and then checks the @customer object for 
errors.

Does this sound right?  It sounds like I might be missing something 
fundamental here.

Thanks for looking.  :)
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to