Ruby on Rails Thursday, March 1, 2012

Rails3.1.3

I have db type,

startp:integer

I need to change it to float. More specifically,

1.2, 45.1, 143.8 ...

I have two questions:

1. Is removing and adding the field through migration the only way?
in other words, is there a single command to change the type?

2. Is there anyway to limit the decimal place to only one?
56.3, 34.2... are acceptable, but 23.112, 77.34, ... are not.

Thanks in advance.

soichi

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

No comments:

Post a Comment