diff options
-rw-r--r-- | activemodel/lib/active_model/errors.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 2d559e06d4..3ba33bee4d 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -119,6 +119,11 @@ module ActiveModel # @option override_options [Symbol] :attribute Override the attribute the error belongs to # @option override_options [Symbol] :type Override type of the error. def import(error, override_options = {}) + [:attribute, :type].each do |key| + if override_options.key?(key) + override_options[key] = override_options[key].to_sym + end + end @errors.append(NestedError.new(@base, error, override_options)) end |