Dear all

I type the following command in script/console and got the error
"ActiveRecord::StatementInvalid: ActiveRecord::ActiveRecordError: JZ0NK:
......Statement.NO_GENERATED_KEYS"

It is quit strange that the title is nil when I saved the record....This
problem only happened in the rails console. It is no problem in my irb.
Please help me. Thank you.

>> user
=> #<User name: "aaa", title: nil, created_at: "2008-11-28 07:02:26",
updated_at: "2008-11-28 07:02:
26">
>> user = User.new
=> #<User name: nil, title: nil, created_at: nil, updated_at: nil>
>> User
=> User(name: string, title: string, created_at: datetime, updated_at:
datetime)
>> user=User.new
=> #<User name: nil, title: nil, created_at: nil, updated_at: nil>
>> user.name = "aaaaa"
=> "aaaaa"
>> user.title = "bbbbb"
=> "bbbbb"
>> user
=> #<User name: "aaaaa", title: nil, created_at: nil, updated_at: nil>
>> user.save
ActiveRecord::StatementInvalid: ActiveRecord::ActiveRecordError: JZ0NK:
???銝?剁?
?蛹雿輻鈭?Statement.NO_GENERATED_KEYS ?僎?芾?函???? INSERT INTO users
(title, created_at
, updated_at, name) VALUES(NULL, '2008-11-28 07:04:11', '2008-11-28
07:04:11', 'aaaaa')
        from
C:/jruby-1.1.5/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions
.rb:167:in `rollback_active_record_state!'
        from
C:/jruby-1.1.5/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions
.rb:146:in `save_with_transactions'
        from (irb):16
        from C:/jruby-1.1.5/lib/ruby/1.8/irb.rb:150:in `eval_input'
        from C:/jruby-1.1.5/lib/ruby/1.8/irb.rb:259:in `signal_status'
        from C:/jruby-1.1.5/lib/ruby/1.8/irb.rb:147:in `eval_input'
        from C:/jruby-1.1.5/lib/ruby/1.8/irb.rb:146:in `eval_input'
        from C:/jruby-1.1.5/lib/ruby/1.8/irb.rb:70:in `start'
        from C:/jruby-1.1.5/lib/ruby/1.8/irb.rb:69:in `catch'
        from C:/jruby-1.1.5/lib/ruby/1.8/irb.rb:69:in `start'
        from C:/jruby-1.1.5\bin\jirb:21
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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