# New record doesn't appear in db yet rails shows save success

**URL:** <https://www.ruby-forum.com/t/new-record-doesnt-appear-in-db-yet-rails-shows-save-success/157852>\
**Category:** Rails\
**Created:** [January 16, 2009, 12:21am UTC](https://www.ruby-forum.com/t/new-record-doesnt-appear-in-db-yet-rails-shows-save-success/157852 "2009-01-16T00:21:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubylicious](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@rubylicious](https://www.ruby-forum.com/u/rubylicious)\
**Post date:** [January 16, 2009, 12:21am UTC](https://www.ruby-forum.com/t/new-record-doesnt-appear-in-db-yet-rails-shows-save-success/157852/1 "2009-01-16T00:21:54Z")

</div>

This is a first for me so bear with the example.  
Simple 2 model application with simple relationship between the two  
models.

Models:  
Transaction “has\_many :steps”  
Step “belongs\_to :transaction”

Database tables:  
transactions (id:integer, name:string)  
steps (id:integer, transaction\_id:integer)

So based on this I can create a new transaction in the database no  
problem. When I try to create a new step for that transaction, rails  
reports NO error, no excpetions (even with @step.save!), or any other  
problems during the “CREATE” yet the database doesn’t show the new  
record.

I’ve even validated that the save routine executes, yet the development  
log doesn’t show the actual “INSERT” statement. It seems to skip the  
insert.

If I comment out the relationship everything works fine. I’d like to be  
able to use scope when referencing objects so this is very annoying.

What gives? Is it my choice of names for my models? I haven’t been  
able to find anything that shows my model names are in conflict with a  
protected keyword (I know transaction is technically an active record  
method)

Help!

---

<div class="post-metadata">

**Author:** ![rubylicious](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@rubylicious](https://www.ruby-forum.com/u/rubylicious)\
**Post date:** [January 16, 2009, 1:09am UTC](https://www.ruby-forum.com/t/new-record-doesnt-appear-in-db-yet-rails-shows-save-success/157852/2 "2009-01-16T01:09:47Z")

</div>

Transaction is a reserved word:

[http://wiki.rubyonrails.org/rails/pages/ReservedWords](http://wiki.rubyonrails.org/rails/pages/ReservedWords)

Try changing the name of your model.

Regards,  
Craig

---

<div class="post-metadata">

**Author:** ![rubylicious](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@rubylicious](https://www.ruby-forum.com/u/rubylicious)\
**Post date:** [January 16, 2009, 1:45am UTC](https://www.ruby-forum.com/t/new-record-doesnt-appear-in-db-yet-rails-shows-save-success/157852/3 "2009-01-16T01:45:28Z")

</div>

On 16 Jan 2009, at 00:09, Craig D. wrote:

> Transaction is a reserved word:
> 
> [http://wiki.rubyonrails.org/rails/pages/ReservedWords](http://wiki.rubyonrails.org/rails/pages/ReservedWords)
> 
> Try changing the name of your model.

It’s not so much that Transaction is a reserved class name but that  
transaction is a reserved method name (not in 2.3 and higher)

Fred
