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:
parent
07a41ecf6f
commit
6d5bccc050
2 changed files with 9 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -110,4 +110,8 @@ class ValidatableTest < ActiveSupport::TestCase
|
|||
Class.new.send :include, Devise::Models::Validatable
|
||||
end
|
||||
end
|
||||
|
||||
test 'required_fields should be an empty array' do
|
||||
assert_equal Devise::Models::Validatable.required_fields(User), []
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue