aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/errors.rb
diff options
context:
space:
mode:
authorYuki Nishijima <mail@yukinishijima.net>2014-11-27 17:44:36 -0800
committerYuki Nishijima <mail@yukinishijima.net>2014-11-27 17:56:12 -0800
commit5142d5411481c893f817c1431b0869be3745060f (patch)
tree778a8d22df1baec013b51980215767ede95808c5 /activerecord/lib/active_record/errors.rb
parent200b9035daa81535d385544b1ce8f3cfa17d0a33 (diff)
downloadrails-5142d5411481c893f817c1431b0869be3745060f.tar.gz
rails-5142d5411481c893f817c1431b0869be3745060f.tar.bz2
rails-5142d5411481c893f817c1431b0869be3745060f.zip
Fix a bug where AR::RecordNotSaved loses error messages
Since 3e30c5d, it started ignoring the given error message. This commit changes the behavior of AR::RecordNotSaved#initialize so that it no longer loses the given error message.
Diffstat (limited to 'activerecord/lib/active_record/errors.rb')
-rw-r--r--activerecord/lib/active_record/errors.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb
index 14819aab54..fc28ab585f 100644
--- a/activerecord/lib/active_record/errors.rb
+++ b/activerecord/lib/active_record/errors.rb
@@ -54,9 +54,9 @@ module ActiveRecord
class RecordNotSaved < ActiveRecordError
attr_reader :record
- def initialize(record)
+ def initialize(message, record = nil)
@record = record
- super()
+ super(message)
end
end