Skip to content

Instantly share code, notes, and snippets.

@danahern
Created January 15, 2009 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danahern/47618 to your computer and use it in GitHub Desktop.
Save danahern/47618 to your computer and use it in GitHub Desktop.
> news = New.new
=> #<New:0x2228038 @attributes={"pillar_type_id"=>nil, "created_on"=>nil, "title"=>nil, "updated_on"=>nil, "content"=>nil, "user_id"=>nil, "image"=>nil}, @new_record=true>
>> news.title = 'test'
=> "test"
>> news.content = 'test'
=> "test"
>> news.id = 500
=> 500
>> news
=> #<New:0x2228038 @attributes={"pillar_type_id"=>nil, "created_on"=>nil, "title"=>"test", "updated_on"=>nil, "id"=>500, "content"=>"test", "user_id"=>nil, "image"=>nil}, @new_record=true>
>> news.save
=> true
>> news
=> #<New:0x2228038 @errors=#<ActiveRecord::Errors:0x220ec00 @errors={}, @base=#<New:0x2228038 ...>>, @image_state=#<FileColumn::NoUploadedFile:0x220e728 @instance=#<New:0x2228038 ...>, @options_method=:image_options, @attr="image">, @attributes={"pillar_type_id"=>nil, "created_on"=>Thu Jan 15 14:01:03 -0700 2009, "title"=>"test", "updated_on"=>Thu Jan 15 14:01:03 -0700 2009, "id"=>500, "content"=>"test", "user_id"=>nil, "image"=>nil}, @new_record=false>
>> news_2 = New.new
=> #<New:0x21f75b4 @attributes={"pillar_type_id"=>nil, "created_on"=>nil, "title"=>nil, "updated_on"=>nil, "content"=>nil, "user_id"=>nil, "image"=>nil}, @new_record=true>
>> news_2.title = 'test'
=> "test"
>> news_2.content = 'test'
=> "test"
>> news_2.id = news.id+1
=> 501
>> news_2.save
=> true
>> news_2
=> #<New:0x21f75b4 @errors=#<ActiveRecord::Errors:0x21e23bc @errors={}, @base=#<New:0x21f75b4 ...>>, @image_state=#<FileColumn::NoUploadedFile:0x21e2290 @instance=#<New:0x21f75b4 ...>, @options_method=:image_options, @attr="image">, @attributes={"pillar_type_id"=>nil, "created_on"=>Thu Jan 15 14:21:10 -0700 2009, "title"=>"test", "updated_on"=>Thu Jan 15 14:21:10 -0700 2009, "id"=>501, "content"=>"test", "user_id"=>nil, "image"=>nil}, @new_record=false>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment