nil.enroll(aetheric_username, quantum_class_id) (adric) wrote,
nil.enroll(aetheric_username, quantum_class_id)

Is the data there or not? Seriously, just pick one

Having stumped one nice fellow on #rubyonrails, I inflict this on you all:

I can make a new object, which is then empty. Sure. I run a method to populate the fields which runs fine and debug out some correctfield data. Inspecting or printing the method shows it is still empty, but if I ask politely the data is there (accessors and to_string). But. When I ask it to save the data, it writes out all NULLS, which is wrong and also causes the DB to throw back an error (since some of those fields are Not Null in the schema). Elipsises mine to cut down on the number of times you need to read nil and NULL.
>> @moo.to_s
=> "first last-name was Zen order 27,\n      so we'll call it number 27."
>> @moo.moocash_orders_id
=> 27
>> @moo.inspect
=> "#< MoocashOrder moocash_id: nil, moocash_orders_id: nil, student_fname: nil, ...
 nil, is_paid_up: false, created_at: \"2008-11-06 17:40:30\", updated_at: \"2008-11-06 17:40:30\">"
ActiveRecord::StatementInvalid: SQLite3::SQLException: SQL logic error or missing database: 
INSERT INTO "moocash_orders" ("moocash_orders_id", ... "created_at") 
VALUES(NULL, ... NULL, '2008-11-06 17:40:30', '2008-11-06 17:40:30')
ETA: Trying out the scaffold views shows that they really don't work right either... tried and fix some of that ("id") to see if it helps. This also may indicate further misalignment of gnats and crumbs in the sqlite3 RAILS_ENV=test. Also my joins may not be right, although I'm not using them anywhere that I know of. sqlite returns data when I "select * from yen_orders" but rails scaffold just shows buttons or polite nothing...
Tags: bug, rails

  • Ugh.. 'Friday'

    What a needlessly exciting evening ... I was 3 hours late to work (overslept, left no instructions local to me) .. have since added a Wake-Up alarm…

  • Another request?

    Sorry, but I'm not pulling them on right now, jut got out of shower and it's way too warm.

  • Please *do* glorify some great hackers and not crime

    Please *do* glorify some great hackers and not crime Re: "Stop Glorifying Hackers"(sic) from the M. McWhorter, I'm sorry you had trouble safely…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded