Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/active_resource/validations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def from_array(messages, save_cache = false)
add humanized_attributes[attr_name], message[(attr_name.size + 1)..-1]
end
end
self[:base] << message if attr_message.nil?
add(:base, message) if attr_message.nil?
end
end

Expand All @@ -40,11 +40,11 @@ def from_hash(messages, save_cache = false)
if @base.known_attributes.include?(key)
add key, error
elsif key == "base"
self[:base] << error
add(:base, error)
else
# reporting an error on an attribute not in attributes
# format and add them to base
self[:base] << "#{key.humanize} #{error}"
add(:base, "#{key.humanize} #{error}")
end
end
end
Expand Down