Hi --

On Mon, 14 Sep 2009, Kendall Buchanan wrote:

>
> Colin Law wrote:
>> 2009/9/14 Kendall Buchanan <[email protected]>:
>>> saved to the database. I'd like it to not save.
>>>
>>> Am I missing something simple?
>>
>> Are you sure it is getting saved?  Are you checking the return from
>> save, it should return false if the save fails.  If you still think it
>> is not functioning correctly post the relevant section of controller
>> code here.
>>
>> Colin
>
> Sure.
>
> Yeah, it's getting saved by an INSERT statement. Here's the controller
> code:

Nothing definite springs to mind, but a couple of questions:

At the moment you're getting the "false" result, what do the errors
look like?

Your validations have a big "if" in them (if self.payment). What's the
status of that when the record is being saved?

You have an after_create hook. Is it possible that that hook is doing
something that's making the record invalid after it's already been
saved?


David

-- 
David A. Black, Director
Ruby Power and Light, LLC (http://www.rubypal.com)
Ruby/Rails training, consulting, mentoring, code review
Book: The Well-Grounded Rubyist (http://www.manning.com/black2)

--~--~---------~--~----~------------~-------~--~----~
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 [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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to