On 6 Nov 2007, at 10:58, Kless wrote:
>
> Which is the difference between *:null => true* and *:default =>
nil*?
>
:null => true/false is whether the column is not null or not. At least
on my version of mysql, the default is that null is allowed.
:default => nil says that the default value for the column is null
(which is the default).
> If a field is going to be optional, which option of those would be the
> best?
> *t.string :optional, :null => true*
>
> or
> *t.string :optional, default => nil*
>
t.string :optional, :null => true corresponds to what you actually
want. You probably don''t need :null => true since I believe
it''s the
default
Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---