Skip to content

Instantly share code, notes, and snippets.

@mcwqy9
Created August 31, 2012 05:11
Show Gist options
  • Save mcwqy9/3549267 to your computer and use it in GitHub Desktop.
Save mcwqy9/3549267 to your computer and use it in GitHub Desktop.
Quimbee judge migration console debugging
1.9.3p194 :003 > Case.first.holding
Case Load (0.7ms) SELECT "cases".* FROM "cases" LIMIT 1
=> "(Marshall, C.J.) (1) Yes. Marbury does have a right...
1.9.3p194 :004 > Case.first
Case Load (1.7ms) SELECT "cases".* FROM "cases" LIMIT 1
=> #<Case case_id: 706844, member_id: 0, name: "Marbury v. Madison", court_name: "United States Supreme Court", full_citation: "5 U.S. (1 Cranch) 137 (1803)", rule: "The Supreme Court of the United States has the auth...", facts: "William Marbury (plaintiff) was appointed Justice o...", issues: "(1)<b> </b>Does Marbury have the right to his judic...", holding: "(Marshall, C.J.) (1) Yes. Marbury does have a right...", status: 1, date_added: "2012-01-03 01:23:54", viewed_at: "2012-01-03 01:23:54", viewed_times: 504, meta_description: nil, meta_keywords: nil, subject_id: nil, casebook_id: nil, video_id: nil, judge_name: nil>
[In another window]
Matthews-MacBook-Pro:Quimbee Matt$ bundle exec rake db:migrate
== TransitionJudgenameOut: migrating =========================================
== TransitionJudgenameOut: migrated (0.3253s) ================================
== RemoveJudgenameFromHoldingColumn: migrating ===============================
== RemoveJudgenameFromHoldingColumn: migrated (0.4214s) ======================
[Back in the console]
1.9.3p194 :008 > quit
Matthews-MacBook-Pro:Quimbee Matt$ rails c
Loading development environment (Rails 3.2.6)
1.9.3p194 :002 > Case.find(706844).holding
Case Load (45.4ms) SELECT "cases".* FROM "cases" WHERE "cases"."case_id" = $1 LIMIT 1 [["case_id", 706844]]
=> "(Marshall, C.J.) (1) Yes. Marbury does have a right...
1.9.3p194 :003 > Case.find(706844)
Case Load (0.4ms) SELECT "cases".* FROM "cases" WHERE "cases"."case_id" = $1 LIMIT 1 [["case_id", 706844]]
=> #<Case case_id: 706844, member_id: 0, name: "Marbury v. Madison", court_name: "United States Supreme Court", full_citation: "5 U.S. (1 Cranch) 137 (1803)", rule: "The Supreme Court of the United States has the auth...", facts: "William Marbury (plaintiff) was appointed Justice o...", issues: "(1)<b> </b>Does Marbury have the right to his judic...", holding: "(Marshall, C.J.) (1) Yes. Marbury does have a right...", status: 1, date_added: "2012-01-03 01:23:54", viewed_at: "2012-01-03 01:23:54", viewed_times: 504, meta_description: nil, meta_keywords: nil, subject_id: nil, casebook_id: nil, video_id: nil, judge_name: "">
1.9.3p194 :009 > Case.first(1000).map(&:judge_name).compact!
Case Load (27.5ms) SELECT "cases".* FROM "cases" LIMIT 1000
=> nil
Note the judge names all came out as empty strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment