Skip to content

Instantly share code, notes, and snippets.

@runlevel5
Created July 16, 2010 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save runlevel5/477951 to your computer and use it in GitHub Desktop.
Save runlevel5/477951 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
acts_as_authentic do |c|
c.transition_from_restful_authentication = true
#AuthLogic defaults
#c.validate_email_field = true
#c.validates_length_of_email_field_options = {:within => 6..100}
#c.validates_format_of_email_field_options = {:with => email_regex, :message => I18n.t(‘error_messages.email_invalid’, :default => “should look like an email address.”)}
#c.validate_password_field = true
#c.validates_length_of_password_field_options = {:minimum => 4, :if => :require_password?}
#for more defaults check the AuthLogic documentation
end
end
#----------------------------------------------------------
module Spree::Models::User
def self.included(target)
target.class_eval do
acts_as_authentic do |c|
c.transition_from_restful_authentication = true
c.validate_email_field = false
end
end
end
end
#-------------------------------------------------
User.send :include, Spree::Models::User
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment