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 => “removed_[email protected]”, :password => “password1”).save
Up argument ‘= User.new(:email => “[email protected]”, :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.
Never mind, it seems that I can not assign to a single char variable in the
debugger:
u = User.new
That 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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.