mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
ActiveRecord::RecordInvalid now states which validations failed in its default error message
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3544 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -8,9 +8,9 @@ module ActiveRecord
|
||||
# end
|
||||
class RecordInvalid < ActiveRecordError
|
||||
attr_reader :record
|
||||
def initialize(record, *args)
|
||||
def initialize(record)
|
||||
@record = record
|
||||
super(*args)
|
||||
super("Validation failed: #{@record.errors.full_messages.join(", ")}")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user