Esim.
t.string :site, :null => false, :default => 'icanhascheezburger.com'
--
"One day, when he was naughty, Mr Bunnsy looked over the hedge into
Farmer Fred's field and it was full of fresh green lettuces. Mr
Bunnsy, however, was not full of lettuces. This did not seem fair."
-- Terry Pratchett, Mr. Bunnsy Has An Adventure
>> Kuinka saan määriteltyä Not Null ja Defaultin tässä yllä olevassa
>> luokassa.
>
> Esim.
>
> t.string :site, :null => false, :default => 'icanhascheezburger.com'
Nämä kaikki löytyvät muuten Railsin api-dokumentaatiosta (esim. http://edgedocs.planetargon.org
):
http://edgedocs.planetargon.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#M002211
http://edgedocs.planetargon.org/classes/ActiveRecord/ConnectionAdapters/TableDefinition.html#M002278
//jarkko
--
Jarkko Laine
http://jlaine.net
http://dotherightthing.com
http://www.railsecommerce.com
http://odesign.fi