Skip to content

Instantly share code, notes, and snippets.

@DougHall
Created October 11, 2012 19:47
Show Gist options
  • Save DougHall/3875038 to your computer and use it in GitHub Desktop.
Save DougHall/3875038 to your computer and use it in GitHub Desktop.
ActiveRecord record save not getting parameters
>> ss = ScoreSession.create!(:assessor_id => 2,:group_id => 4, :cluster => "B", :line => "C")
(0.5ms) BEGIN
SQL (68.0ms) INSERT INTO "score_sessions" ("assessor_id", "cluster", "created_at", "ended_at", "group_id", "line", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["assessor_id", 2], ["cluster", nil], ["created_at", Thu, 11 Oct 2012 14:42:05 CDT -05:00], ["ended_at", nil], ["group_id", 4], ["line", nil], ["updated_at", Thu, 11 Oct 2012 14:42:05 CDT -05:00]]
(0.1ms) ROLLBACK
ActiveRecord::StatementInvalid: PG::Error: ERROR: null value in column "line" violates not-null constraint
DETAIL: Failing row contains (13, 2, null, 2012-10-11 19:42:05.959018, 2012-10-11 19:42:05.959018, null, 4, null).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment