#155 new
Yang

Conflic with AASM (Acts_as_state_machine)?

Reported by Yang | December 1st, 2009 @ 03:31 AM

Hi,

I am using Authlogic with AASM for tracking state changes of a user. In User model, I have acts_as_authetic, and I expected all the default validations would work - email format, uniqueness, etc., but it didn't.

I tried both using plain vanilla acts_as_authentic and the following configuration, but the results were the same.

acts_as_authentic do |c|

c.validates_length_of_password_field_options = {:on => :update, :minimum => 4, :if => :has_no_credentials?}
c.validates_length_of_password_confirmation_field_options = {:on => :update, :minimum => 4, :if => :has_no_credentials?}
c.validates_format_of_email_field_options = {:with => Authlogic::Regex.email, :message => "should look like an email address."} 
c.validates_uniqueness_of_email_field_options = {:case_sensitive => false, :scope => validations_scope, :if => "#{email_field}_changed?".to_sym} 
c.crypted_password_field = :hashed_password

end

I searched on the web, but either I am the only person with this kind of problem or no one really uses Authlogic and AASM together..... :(

Any help would be much much appreciated!

Thanks,

No comments found

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