Re: [Rails] deciml

2010-04-05 Thread Colin Law
On 5 April 2010 09:54, Tom Mac  wrote:
> Hi
>   In my table I have
> t.decimal :rent, :precision => 12, :scale => 2
>
>    But when ever I enter a large value like
> 1234567890333.465
>
>    To the table it is stored as 99.99
>
>         I would like to know how active record validation can be
> applied here?

Have a look at the rails guide on validations at
http://guides.rubyonrails.org.  Particularly validates_numericality_of
which allows a range of values to be specified.

Colin

-- 
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.



[Rails] deciml

2010-04-05 Thread Tom Mac
Hi
   In my table I have
t.decimal :rent, :precision => 12, :scale => 2

But when ever I enter a large value like
1234567890333.465

To the table it is stored as 99.99

 I would like to know how active record validation can be
applied here?


Thanks
Tom
-- 
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.