【发布时间】:2010-09-07 16:32:45
【问题描述】:
我每次尝试从控制台创建用户时都会遇到此错误。我以前可以这样做,但是自从我关闭了 PT 维护后,这可能会成为一个问题。
问题是我确实使用 Authlogic::Random.friendly_token 为 PT 提供了一个值,但似乎这个值从未出现在 SQL 语句中。
我需要做什么?
ActiveRecord::StatementInvalid: /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract_adapter.rb:219:in log': Mysql::Error: Column 'perishable_token' cannot be null: INSERT INTOusers(city ,zip,created_at,single_access_token,image_file_name,voting_power,crypted_password,image_file_size,image_url,updated_at,perishable_token,username,role_id@987654335 @image_content_type,lng,posts_count,failed_login_count,current_login_ip,sex,password_salt,current_login_at,persistence_token,login_count,last_login_ip,age,lat ,last_login_at,image_updated_at,email,state,active,processing`)值(NULL,'94131','2010-09-07 16:26:38',2QNrXMQ036:38' , NULL, 0, '3590f21c99ecad3fa2ece943d23f55af735e9713d0d325111763b1 0b3e3f8a455e7ed323b6b3f5d7a721f5afc81beff5da1f2d6b20454c399751eed1623d3b7d', NULL, NULL, '2010-09-07 16:26:38', NULL, 'asitmi', NULL, NULL, NULL, 0, 0, NULL, 1, 'mrqq5O4gFsyMcExLEOsH', NULL, 'b3ff5cd7e942212b1976f8d57941516489a0cbc4360493ff3f9b2e17e4aae48c3f53944674745ef911ca0947f62d2b5d6da10a55f7b9073f1b4c4f0b6f68b540', 0, NULL, 34, NULL, NULL, NULL, 'adfds@fddas.com', NULL, NULL, 1)
acts_as_authentic do |a|
a.validates_length_of_password_field_options = { :within => 1..15, :on =>:update, :if => :has_no_credential?}
a.validates_length_of_login_field_options = { :within => 1..15, :on =>:update, :if => :has_no_credential?}
a.account_merge_enabled true
# set Authlogic_RPX account mapping mode
a.account_mapping_mode :internal
a.disable_perishable_token_maintenance = true
a.login_field = 'username'
end
【问题讨论】: