On Nov 27, 7:25 pm, Rofb <[email protected]> wrote:
> My server is running Rails 2.3.4...am I not doing this correctly or is
> something borked?
>
> >> c=Contact.last
>
> => #<Contact id: 24, name: "Larry", email: "[email protected]", phone:
> 2147483647, account_id: 8, created_at: "2009-11-27 18:16:25",
> updated_at: "2009-11-27 18:40:08", hide_name: false, hide_phone:
> false, hide_email: false>>> c.update_attribute('phone',8888888888)
> => true
> >> c
>
> => #<Contact id: 24, name: "Larry", email: "[email protected]", phone: ,
> 8888888888, account_id: 8, created_at: "2009-11-27 18:16:25",
> updated_at: "2009-11-27 19:15:43", hide_name: false, hide_phone:
> false, hide_email: false>>> Contact.last
>
> => #<Contact id: 24, name: "Larry", email: "[email protected]", phone:
> 2147483647, account_id: 8, created_at: "2009-11-27 18:16:25",
> updated_at: "2009-11-27 19:15:43", hide_name: false, hide_phone:
> false, hide_email: false>
>
Looks like the phone number is getting set to 2^31-1, which might
happen if the data type of the column isn't big enough to hold the
value 8888888888 (personally I keep things like phone numbers as
strings - although it's called a 'phone number' it's not really a
number in that things like leading zeroes, punctuation (eg # to select
someone's extension) are often significant).

Fred
> I've been tearing my hair out over this..please help.

--

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