#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'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:320:in `execute'
	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'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:330:in `insert_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'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/query_cache.rb:18:in `insert'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2902:in `create_without_timestamps'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/timestamp.rb:29:in `create_without_callbacks'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/callbacks.rb:266:in `create'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2868:in `create_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'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2539:in `save_without_validation'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/validations.rb:1009:in `save_without_dirty'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/dirty.rb:79:in `save_without_transactions'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:229:in `send'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:229:in `with_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'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:182:in `transaction'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:196:in `save'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:196:in `save'

Comments and changes to this ticket

  • Imanel

    Imanel March 23rd, 2009 @ 05:06 AM

    After a few minutes of testing it appears that it's connected with no password field validation - in 2.0.0 only password_confirmation is validated, so when we have empty password all validations are ok, but crypted password generator fails. Validation of password presence should resolve problem.

    Another thing is that now in 2.0.0 there's no way to validate presence and length of password(only password_confirmation). I think it is wrong choice(or maybe bug?) because usually we want to check password and after that check if password_confirmation is identical to password.

  • Ben Johnson

    Ben Johnson March 23rd, 2009 @ 05:18 AM

    • State changed from “new” to “resolved”

    Thanks for letting me know about this. This is all fixed, I added a validation for the length of the password.

  • Kristy23
  • Toby Angelo

    Toby Angelo August 20th, 2019 @ 06:07 AM

    Logic of the light house is played down for the happiness of the candidates. The chips of the calculation and best assignment writing service are accentuated for the future times. The momentum is shared for the approval of the terms for the humans. The light house isoprene for the approval of the teams for the humans. The accentuation is done for the fatal items for the humans.

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