aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/errors.rb
diff options
context:
space:
mode:
authorBogdan Gusiev <agresso@gmail.com>2015-01-23 13:57:34 +0200
committerBogdan Gusiev <agresso@gmail.com>2015-01-23 23:43:22 +0200
commit2606fb339797a99c50e531105fc92071cef3db01 (patch)
tree9de175ae320de5487adb4d32bb29c3894529805b /activerecord/lib/active_record/errors.rb
parent139c232b075da940cdf1042dcaad4c3b514908c9 (diff)
downloadrails-2606fb339797a99c50e531105fc92071cef3db01.tar.gz
rails-2606fb339797a99c50e531105fc92071cef3db01.tar.bz2
rails-2606fb339797a99c50e531105fc92071cef3db01.zip
Extracted `ActiveRecord::AttributeAssignment` to `ActiveModel::AttributesAssignment`
Allows to use it for any object as an includable module.
Diffstat (limited to 'activerecord/lib/active_record/errors.rb')
-rw-r--r--activerecord/lib/active_record/errors.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb
index fc28ab585f..d710d96a9a 100644
--- a/activerecord/lib/active_record/errors.rb
+++ b/activerecord/lib/active_record/errors.rb
@@ -178,18 +178,10 @@ module ActiveRecord
class DangerousAttributeError < ActiveRecordError
end
- # Raised when unknown attributes are supplied via mass assignment.
- class UnknownAttributeError < NoMethodError
-
- attr_reader :record, :attribute
-
- def initialize(record, attribute)
- @record = record
- @attribute = attribute.to_s
- super("unknown attribute '#{attribute}' for #{@record.class}.")
- end
-
- end
+ UnknownAttributeError = ActiveSupport::Deprecation::DeprecatedConstantProxy.new( # :nodoc:
+ 'ActiveRecord::UnknownAttributeError',
+ 'ActiveModel::AttributeAssignment::UnknownAttributeError'
+ )
# Raised when an error occurred while doing a mass assignment to an attribute through the
# +attributes=+ method. The exception has an +attribute+ property that is the name of the