#57 ✓resolved
Imanel

User creation not working in Authlogic 2.0.0

Reported by Imanel | March 23rd, 2009 @ 04:50 AM

After update to 2.0.0 user won't create.
To reproduce(Ruby 1.8.7, Rails 2.3.2):

app/models/user.rb

class User < ActiveRecord::Base
  acts_as_authentic
end

Now in console:

>> u = User.new
=> #<User id: nil, login: nil, email: nil, crypted_password: nil, password_salt: nil, persistence_token: nil, perishable_token: nil, created_at: nil, updated_at: nil>
>> u.login = "test"
=> "test"
>> u.email = "test@example.org"
=> "test@example.org"
>> u.password_confirmation = "test"
=> "test"
>> u.valid?
=> true
>> u.save
ActiveRecord::StatementInvalid: Mysql::Error: Column 'crypted_password' cannot be null: INSERT INTO users (created_at, crypted_password, perishable_token, updated_at, password_salt, persistence_token, login, email) VALUES('2009-03-23 08:49:09', NULL, '3u5k1taxovJfApLyc-UQ', '2009-03-23 08:49:09', NULL, '325fda60c4b9f85c9f0d17ce8c231ad4c1f57ee8b4f1e4e1abbef654e3e93669855720e52af21d24b1a2cc97b4888d75d391090ad1c355b4e85d66d53e378cf1', 'test', 'test@example.org')
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract_adapter.rb:212:in log&#39;
    from &#47;usr&#47;lib&#47;ruby&#47;gems&#47;1.8&#47;gems&#47;activerecord-2.3.2&#47;lib&#47;active_record&#47;connection_adapters&#47;mysql_adapter.rb:320:inexecute'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:259:in insert_sql&#39;
    from &#47;usr&#47;lib&#47;ruby&#47;gems&#47;1.8&#47;gems&#47;activerecord-2.3.2&#47;lib&#47;active_record&#47;connection_adapters&#47;mysql_adapter.rb:330:ininsert_sql'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:44:in insert_without_query_dirty&#39;
    from &#47;usr&#47;lib&#47;ruby&#47;gems&#47;1.8&#47;gems&#47;activerecord-2.3.2&#47;lib&#47;active_record&#47;connection_adapters&#47;abstract&#47;query_cache.rb:18:ininsert'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2902:in create_without_timestamps&#39;
    from &#47;usr&#47;lib&#47;ruby&#47;gems&#47;1.8&#47;gems&#47;activerecord-2.3.2&#47;lib&#47;active_record&#47;timestamp.rb:29:increate_without_callbacks'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/callbacks.rb:266:in create&#39;
    from &#47;usr&#47;lib&#47;ruby&#47;gems&#47;1.8&#47;gems&#47;activerecord-2.3.2&#47;lib&#47;active_record&#47;base.rb:2868:increate_or_update_without_callbacks'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/callbacks.rb:250:in create_or_update&#39;
    from &#47;usr&#47;lib&#47;ruby&#47;gems&#47;1.8&#47;gems&#47;activerecord-2.3.2&#47;lib&#47;active_record&#47;base.rb:2539:insave_without_validation'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/validations.rb:1009:in save_without_dirty&#39;
    from &#47;usr&#47;lib&#47;ruby&#47;gems&#47;1.8&#47;gems&#47;activerecord-2.3.2&#47;lib&#47;active_record&#47;dirty.rb:79:insave_without_transactions'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:229:in send&#39;
    from &#47;usr&#47;lib&#47;ruby&#47;gems&#47;1.8&#47;gems&#47;activerecord-2.3.2&#47;lib&#47;active_record&#47;transactions.rb:229:inwith_transaction_returning_status'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in transaction&#39;
    from &#47;usr&#47;lib&#47;ruby&#47;gems&#47;1.8&#47;gems&#47;activerecord-2.3.2&#47;lib&#47;active_record&#47;transactions.rb:182:intransaction'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:228:in with_transaction_returning_status&#39;
    from &#47;usr&#47;lib&#47;ruby&#47;gems&#47;1.8&#47;gems&#47;activerecord-2.3.2&#47;lib&#47;active_record&#47;transactions.rb:196:insave'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:208:in rollback_active_record_state!&#39;
    from &#47;usr&#47;lib&#47;ruby&#47;gems&#47;1.8&#47;gems&#47;activerecord-2.3.2&#47;lib&#47;active_record&#47;transactions.rb:196:insave'

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Object based authentication solution that handles all of the non sense for you. It's as easy as ActiveRecord is with a database.

People watching this ticket

Pages