Rails 3.0 Authlogic 2.1.6
Using username (not email) for authentication.
Authlogic requi开发者_如何转开发res username to be at least 3 characters.
How does one convince Authologic to allow a 2 character username?
Thanks for your help.
You can override the authlogic default username length by adding the following code to models/user.rb
class User < ActiveRecord::Base
acts_as_authentic do |c|
c.merge_validates_length_of_login_field_options :within => 4..100
end
#....
end
This assumes your user model is called User
精彩评论