Skip to content

Commit 20d1b98

Browse files
authored
Merge pull request #335 from Shopify/rails-6-1-fixes
Fix Rails 6.1 compatibility
2 parents 71f349a + f9887f6 commit 20d1b98

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/active_resource/validations.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def from_array(messages, save_cache = false)
2222
add humanized_attributes[attr_name], message[(attr_name.size + 1)..-1]
2323
end
2424
end
25-
self[:base] << message if attr_message.nil?
25+
add(:base, message) if attr_message.nil?
2626
end
2727
end
2828

@@ -40,11 +40,11 @@ def from_hash(messages, save_cache = false)
4040
if @base.known_attributes.include?(key)
4141
add key, error
4242
elsif key == "base"
43-
self[:base] << error
43+
add(:base, error)
4444
else
4545
# reporting an error on an attribute not in attributes
4646
# format and add them to base
47-
self[:base] << "#{key.humanize} #{error}"
47+
add(:base, "#{key.humanize} #{error}")
4848
end
4949
end
5050
end

0 commit comments

Comments
 (0)