On Oct 6, 3:39 am, Raistlin Majere
<pedbe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> 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?
>
Well Rails didn''t make it up for you. The book probably had you create
a migration with those columns.
Fred
> 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?
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---