On Wed, March 30, 2011 15:25, Colin Law wrote:

>
> Why do you need infinity as the default value?  Why not make it zero
> for example, or even better use null to indicate no date, which
> would be more conventional.
>
> Colin

That is quite beside the point.  The issue I raise is whether the
framework should be duplicating (poorly) the effect of a built in
function of the the DBMS it is dealing with.  The value of the
column default would be immaterial except for the fact that AR reads
it and then explicitly attempts to set unreferenced attributes to
those values, even when it cannot handle the conversion.  If AR
simply ignored unchanged attributes on INSERT then this problem
would not exist.

Setting a column value to NULL has a number of side effects in
select queries that I would rather avoid having to deal with in
code.  Likewise setting an expected date to one in the past creates
considerable difficulties for validation.  The main reason that
infinity and -infinity were added to PostgreSQL (and I believe to
MySQL) was to deal with both these issues and specifically as
default values.

-- 
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:[email protected]
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to