mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05: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:
parent
0633bb865b
commit
796295dba6
2 changed files with 4 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* ActiveRecord::RecordInvalid now states which validations failed in its default error message [Tobias Luetke]
|
||||
|
||||
* Using AssociationCollection#build with arrays of hashes should call build, not create [DHH]
|
||||
|
||||
* Remove definition of reloadable? from ActiveRecord::Base to make way for new Reloadable code. [Nicholas Seckar]
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue