# Amended: Rails console, saving objects

**URL:** <https://www.ruby-forum.com/t/amended-rails-console-saving-objects/150214>\
**Category:** Rails\
**Created:** [October 6, 2008, 4:39am UTC](https://www.ruby-forum.com/t/amended-rails-console-saving-objects/150214 "2008-10-06T04:39:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raistlin\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9fc348/32.png) [@Raistlin\_M](https://www.ruby-forum.com/u/Raistlin_M)\
**Post date:** [October 6, 2008, 4:39am UTC](https://www.ruby-forum.com/t/amended-rails-console-saving-objects/150214/1 "2008-10-06T04:39:57Z")

</div>

I was reading a book and following the instructions in it.

> > class Story \< ActiveRecord::Base; end  
> > =\> nil
> 
> > story = Story.new  
> > =\> #\<Story id: nil, name: nil, url: nil, created\_at: nil, updated\_at:  
> > nil\>
> 
> > story.class  
> > =\> Story(id: integer, name: string, link: string, created\_at:  
> > datetime, updated\_at: datetime)

I do not remember me asking for id, name, link or url, created\_at and  
updated\_at. Is there a way to check if I asked?

I do know if I typed craeted\_at instead of created\_at or updetad\_at  
instead of updated\_at. Is there a way to check whether I typed it  
right or wrong?

From the Rails console, I had to create a story class, one instance of  
it and save the object, but I created two, so I got a 2 output for a  
story.id input. How do I remove the second object from the database?

---

<div class="post-metadata">

**Author:** ![Raistlin\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9fc348/32.png) [@Raistlin\_M](https://www.ruby-forum.com/u/Raistlin_M)\
**Post date:** [October 6, 2008, 9:40am UTC](https://www.ruby-forum.com/t/amended-rails-console-saving-objects/150214/2 "2008-10-06T09:40:11Z")

</div>

On Oct 6, 3:39 am, Raistlin M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> datetime, updated\_at: datetime)
> 
> I do not remember me asking for id, name, link or url, created\_at and  
> updated\_at. Is there a way to check if I asked?

Well Rails didn’t make it up for you. The book probably had you create  
a migration with those columns.

Fred
