# Record will absolutely not save! so weird, please help

**URL:** <https://www.ruby-forum.com/t/record-will-absolutely-not-save-so-weird-please-help/138593>\
**Category:** Rails\
**Created:** [May 25, 2008, 1:08pm UTC](https://www.ruby-forum.com/t/record-will-absolutely-not-save-so-weird-please-help/138593 "2008-05-25T13:08:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [May 25, 2008, 1:08pm UTC](https://www.ruby-forum.com/t/record-will-absolutely-not-save-so-weird-please-help/138593/1 "2008-05-25T13:08:27Z")

</div>

I have a weird problem going on. All of sudden, records for a certain  
model will not save with #save Please take a look at this:

> > p = Payment.new(:payment\_reason\_id =\> 1, :payment\_method\_id =\> 1, :date =\> Date.today, :amount =\> ‘5.00’, :payable =\> Student.find(608))  
> > =\> #\<Payment id: nil, school\_id: nil, payment\_reason\_id: 1,  
> > payment\_method\_id: 1, date: “2008-05-25”, amount: #\<BigDecimal:  
> > 46958f8,‘0.5E1’,4(8)\>, created\_at: nil, updated\_at: nil, invoice\_id:  
> > nil, creator: nil, check\_number: nil, payable\_type: “Student”,  
> > payable\_id: 608\>
> 
> > p.valid?  
> > =\> false
> 
> > p.school\_id = 1 # school\_id is attr\_protected  
> > =\> 1
> 
> > p.valid?  
> > =\> true
> 
> > p.save  
> > =\> nil
> 
> > p.save!  
> > =\> nil
> 
> > p.save\_with\_validation  
> > =\> true

Why is save returning nil? Why is save\_with\_validation working?

I have a Tuition model that is very similar to the Payment model and  
it does not have this problem. Please help.

---

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [May 25, 2008, 1:17pm UTC](https://www.ruby-forum.com/t/record-will-absolutely-not-save-so-weird-please-help/138593/2 "2008-05-25T13:17:16Z")

</div>

On May 25, 12:07 pm, jko170 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have a weird problem going on. All of sudden, records for a certain  
> model will not save with #save Please take a look at this:

Does your model have a method or association called transaction ?

Fred

---

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [May 25, 2008, 9:21pm UTC](https://www.ruby-forum.com/t/record-will-absolutely-not-save-so-weird-please-help/138593/3 "2008-05-25T21:21:42Z")

</div>

Wow Frederick I feel like an idiot! That completely skipped my mind  
because I have a has\_many :transactions on another model and of course  
that doesn’t cause complications. Thanks for the help!

On May 25, 6:16 am, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
