Skip to content

Instantly share code, notes, and snippets.

@coderforhire
Created December 8, 2011 16:50
Show Gist options
  • Save coderforhire/1447567 to your computer and use it in GitHub Desktop.
Save coderforhire/1447567 to your computer and use it in GitHub Desktop.
appliance = Appliance.new(:venue => "m1234", :ip_address => "123.123.123.123", :last_login => "123545")
=> #<Appliance id: nil, venue: nil, ip_address: nil, last_login: nil, created_at: nil, updated_at: nil>
class Appliance < ActiveRecord::Base
attr_accessible :venue, :ip_address, :last_login
end
~
~
@coderforhire
Copy link
Author

uby-1.9.2-p290 :024 > Appliance.create(:venue => "m1234", :ip_address => "123.123.123.123", :last_login => "123545")
(0.3ms) BEGIN
SQL (0.4ms) INSERT INTO "appliances" ("created_at", "ip_address", "last_login", "updated_at", "venue") VALUES ($1, $2, $3, $4, $5) RETURNING "id" ["created_at", Thu, 08 Dec 2011 16:52:49 UTC +00:00], ["ip_address", nil], ["last_login", nil], ["updated_at", Thu, 08 Dec 2011 16:52:49 UTC +00:00], ["venue", nil] COMMIT
=> #<Appliance id: 6, venue: nil, ip_address: nil, last_login: nil, created_at: "2011-12-08 16:52:49", updated_at: "2011-12-08 16:52:49">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment