Skip to content

Instantly share code, notes, and snippets.

@developish
Created November 9, 2010 01:43
Show Gist options
  • Save developish/668594 to your computer and use it in GitHub Desktop.
Save developish/668594 to your computer and use it in GitHub Desktop.
How to use authogic without requiring a password
class User < ActiveRecord::Base
acts_as_authentic do |config|
config.validate_password_field :if => :require_password_on_signup?
end
def require_password_on_signup?
false
end
end
require 'test_helper'
class UserTest < ActiveSupport::TestCase
test "password requirement" do
@user = User.new
@user.valid?
assert_equal [], @user.errors[:password]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment