Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created April 16, 2009 04:23
Show Gist options
  • Select an option

  • Save practicingruby/96215 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/96215 to your computer and use it in GitHub Desktop.
>> Customer.create(:first_name => "Gregory", :last_name => "Brown")
=> #<Customer:0x20d2120 @prefix_options={}, @attributes={"evening_phone"=>nil, "updated_at"=>Thu Apr 16 03:53:59 UTC 2009, "daytime_phone"=>nil, "id"=>1, "first_name"=>"Gregory", "last_name"=>"Brown", "created_at"=>Thu Apr 16 03:53:59 UTC 2009, "email"=>nil}>
>> Customer.find(:all)
=> [#<Customer:0x20a939c @prefix_options={}, @attributes={"evening_phone"=>nil, "updated_at"=>Thu Apr 16 03:53:59 UTC 2009, "daytime_phone"=>nil, "id"=>1, "first_name"=>"Gregory", "last_name"=>"Brown", "created_at"=>Thu Apr 16 03:53:59 UTC 2009, "email"=>nil}>]
>> Customer.find(1).first_name
=> "Gregory"
>> Customer.delete(1)
=> #<Net::HTTPOK 200 OK readbody=true>
>> Customer.find(:all)
=> []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment