Sorry, I hit tab and space trying to clean up some spacing and gmail
sent the email. Here is my full email:
def addcash(uid)
c = Trade.new
c.attributes = {"user_id" => uid,
"tradetype" => ''9'',
"cash" => 10000}
breakpoint
if c.save
breakpoint
flash[''notice''] = "Signup
successful."
end
end
The first breakpoint generates this for c (the second breakpoint never
triggers):
irb(#<AccountController:0x3a01f78>):001:0> c=> #<Trade:0x39ca7f0
@new_record=true, @attributes={"status"=>"A",
"created_on"=>"0000-00-00 00:00:00",
"price"=>"0",
"updated_on"=>"0000-00-00 00:00:00",
"profit"=>"0.00",
"units"=>"0",
"product_id"=>"0",
"cash"=>10000,
"tradetype"=>"9",
"user_id"=>25}>
The table it is writing to has the following structure:
ield Type Collation Null Key Default
Extra Privileges Comment
---------- ------------- ----------------- ------ ------
------------------- -------------- -------------------------------
-------
id int(11) NULL PRI (NULL)
auto_increment
user_id int(7) NULL 0
product_id int(11) NULL 0
tradetype int(2) NULL 0
units int(7) NULL 0
price int(7) NULL 0
created_on datetime NULL
0000-00-00 00:00:00
updated_on datetime NULL
0000-00-00 00:00:00
status char(2) latin1_swedish_ci A
profit decimal(10,2) NULL 0.00
cash decimal(6,2) NULL 0.00
Thanks very much,
Steve