Grary Stimon wrote:
> So, there is something I will regret either in terms of i) db
> performance or ii) db maintenance by not using default float (int)
> defaults where appropriate?
> 
> My view of the tradeoff was: 1) coding defaults to the attributes in a
> migration vs. 2) calling to_f (to_i)on them in logic.

Personally, I see no "tradeoff" here.

This is a matter of business logic. You want the column to either (a) 
always have a specified rational value or (b) allow the value to be 
unspecified.

I believe that most would agree that setting constraints NOT NULL 
DEFAULT 0.0 would be the most reliable method for implementing (a) in a 
RDBMS.

But, whatever technique you use to disallow NULL values in the database 
is a matter of business logic, regardless of any other considerations, 
such as performance or convenience.
-- 
Posted via http://www.ruby-forum.com/.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to