aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/CHANGELOG2
-rwxr-xr-xactiverecord/lib/active_record/validations.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index 111d645ea9..32cb4562a0 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -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]
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index 3ba2f12ac1..7d1661449c 100755
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -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