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: "larry-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org", 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: "larry-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org", 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: "larry-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org", 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> 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Nov 27, 7:25 pm, Rofb <frostmou...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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: "la...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org", 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: "la...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org", 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: "la...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org", 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
Please check if there is attr_accessible on your model. Add :phone on attr_accessible. On Nov 28, 3:25 am, Rofb <frostmou...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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: "la...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org", 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: "la...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org", 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: "la...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org", 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> > > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
Possibly Parallel Threads
- When adding a record in console, a parameter comes in as null even when I set it
- How do you do a custom sql call in rails?
- CanCan issue when being very specific
- Using set_primary_key breaks acts_as_tree with non-integer column
- dynamic condition for has_one and eager loading issue