We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 71f349a + f9887f6 commit 20d1b98Copy full SHA for 20d1b98
lib/active_resource/validations.rb
@@ -22,7 +22,7 @@ def from_array(messages, save_cache = false)
22
add humanized_attributes[attr_name], message[(attr_name.size + 1)..-1]
23
end
24
25
- self[:base] << message if attr_message.nil?
+ add(:base, message) if attr_message.nil?
26
27
28
@@ -40,11 +40,11 @@ def from_hash(messages, save_cache = false)
40
if @base.known_attributes.include?(key)
41
add key, error
42
elsif key == "base"
43
- self[:base] << error
+ add(:base, error)
44
else
45
# reporting an error on an attribute not in attributes
46
# format and add them to base
47
- self[:base] << "#{key.humanize} #{error}"
+ add(:base, "#{key.humanize} #{error}")
48
49
50
0 commit comments