diff --git a/lib/devise/models/validatable.rb b/lib/devise/models/validatable.rb index 49dc0067..df9206d1 100644 --- a/lib/devise/models/validatable.rb +++ b/lib/devise/models/validatable.rb @@ -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) diff --git a/test/models/validatable_test.rb b/test/models/validatable_test.rb index 6766a2bb..10be9092 100644 --- a/test/models/validatable_test.rb +++ b/test/models/validatable_test.rb @@ -110,4 +110,8 @@ class ValidatableTest < ActiveSupport::TestCase Class.new.send :include, Devise::Models::Validatable end end -end \ No newline at end of file + + test 'required_fields should be an empty array' do + assert_equal Devise::Models::Validatable.required_fields(User), [] + end +end