David Kahn
2010-Dec-11 22:57 UTC
Up argument ''= model.save'' needs to be a number error -- Debugging in server - Rails 3, 1.9.2
When I am debugging in the server on Rails 3/1.9.2 I can not seem to assign a model object to a value: (rdb:1) u = User.new(:email => "a@b.com", :password => "password1").save Up argument ''= User.new(:email => "a@b.com", :password => "password1").save'' needs to be a number. But I can do: (rdb:1) a = 1 1 (rdb:1) And I can do: (rdb:1) str = String String (rdb:1) str String Is this something to do with ActiveRecord perhaps, and if so is there a way to do this. For example I want to assign the model in the first example to a variable so I can ask for the errors. Thanks, David -- 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.
David Kahn
2010-Dec-11 23:00 UTC
[SOLVED] Re: Up argument ''= model.save'' needs to be a number error -- Debugging in server - Rails 3, 1.9.2
Never mind, it seems that I can not assign to a single char variable in the debugger: u = User.new But I can do user = User.new On Sat, Dec 11, 2010 at 4:57 PM, David Kahn <dk-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org>wrote:> When I am debugging in the server on Rails 3/1.9.2 I can not seem to assign > a model object to a value: > > (rdb:1) u = User.new(:email => "a@b.com", :password => "password1").save > Up argument ''= User.new(:email => "a@b.com", :password => > "password1").save'' needs to be a number. > > But I can do: > (rdb:1) a = 1 > 1 > (rdb:1) > > And I can do: > (rdb:1) str = String > String > (rdb:1) str > String > > Is this something to do with ActiveRecord perhaps, and if so is there a way > to do this. For example I want to assign the model in the first example to a > variable so I can ask for the errors. > > Thanks, > > David > >-- 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.
Colin Law
2010-Dec-12 08:05 UTC
Re: [SOLVED] Re: Up argument ''= model.save'' needs to be a number error -- Debugging in server - Rails 3, 1.9.2
On 11 December 2010 23:00, David Kahn <dk-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org> wrote:> Never mind, it seems that I can not assign to a single char variable in the > debugger: > > u = User.newThat is because ''up'' is a debugger command, and ''u'' is the short form of this command. So the debugger assumes you want the command u with parameter = User.new. If you want to use the variable u you can say eval u=User.new or e u=User.new Type help in the debugger to see all the commands. The only reason that you can type things like user=User.new is because autoeval has been set via set autoeval 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-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.