1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Added required fields to validatable

This commit is contained in:
Rodrigo Flores 2012-02-23 14:50:57 -02:00
parent 07a41ecf6f
commit 6d5bccc050
2 changed files with 9 additions and 1 deletions

View file

@ -17,6 +17,10 @@ module Devise
VALIDATIONS = [ :validates_presence_of, :validates_uniqueness_of, :validates_format_of,
:validates_confirmation_of, :validates_length_of ].freeze
def self.required_fields(klass)
[]
end
def self.included(base)
base.extend ClassMethods
assert_validations_api!(base)

View file

@ -110,4 +110,8 @@ class ValidatableTest < ActiveSupport::TestCase
Class.new.send :include, Devise::Models::Validatable
end
end
end
test 'required_fields should be an empty array' do
assert_equal Devise::Models::Validatable.required_fields(User), []
end
end