Re: ActiveRecord uses confusing defaults

Andrew Stone
Fri, 08 Sep 2006 20:22:45 -0000

>
>
> Could you, just as a test, create this table a a corresponding empty
> model and tell me what value Submission.new.postcode returns?
>
> CREATE TABLE `submissions` (
>   `id` int(11) NOT NULL auto_increment,
>   `email` varchar(255) NOT NULL,
>   `fname` varchar(255) NOT NULL,
>   `lname` varchar(255) NOT NULL,
>   `street` varchar(255) NOT NULL,
>   `housenr` int(11) NOT NULL,
>   `housenr_ext` varchar(255) default NULL,
>   `postcode` varchar(6) NOT NULL,
>   `city` varchar(255) NOT NULL,
>   `shirt_type` varchar(255) NOT NULL default ''m'',
>   `shirt_size` varchar(255) NOT NULL default ''l'',
>   `shirt_text` text NOT NULL,
>   `processed_at` datetime default NULL,
>   `approved_at` datetime default NULL,
>   `created_at` datetime NOT NULL,
>   `updated_at` datetime NOT NULL,
>   PRIMARY KEY  (`id`)
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;



I will run this test tomorrow morning and let you know.




--
Andrew Stone