I'm running mysql 5.0.37 rails 2.3.5 on winxp-pro/sp3

I left off precision and scale on my rails app and found my decimal
places missing in the DB.  Did a change of that attribute to (10,2)
via migration:

change_column :expenses, :amount, :decimal, :precision => 10, :scale
=> 2

and dollars-and-cents type data flowed through perfectly.

That's easier than the three-stage solution you used, though
equivalent in effect I believe.
--
Richard

On Mar 17, 7:16 am, Owain <[email protected]> wrote:
> Here are two links that explain that you need to be careful on decimal
> columns when using mysql on the target platform.  sqlite3 is a little
> more forgiving.
>
> http://scottmotte.com/archives/86.htmlhttp://blog.coryfoy.com/2008/06/problems-in-rails-between-development...
>
> I sorted my problem out by running:
>
> rake RAILS_ENV=staging db:drop
> rake RAILS_ENV=staging db:create
> rake RAILS_ENV=staging db:migrate
>
> I am sure that I did this ......... but it could have been very late!
>
> So in a nutshell, use a scale and precision on decimal if you intend
> your target dbms to be mysql.
>
> O.

-- 
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 [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-talk?hl=en.

Reply via email to