diff options
author | Cheah Chu Yeow <chuyeow@gmail.com> | 2008-05-07 13:47:41 +0800 |
---|---|---|
committer | Cheah Chu Yeow <chuyeow@gmail.com> | 2008-05-07 13:47:41 +0800 |
commit | ae6b46f00b5b8b2939c6b37ce3329c83de7e71db (patch) | |
tree | 4c48ae12bb1f96a678d00c763dbcebbe1d8f32f1 /activerecord | |
parent | aca44bcd92ef783abdf484b58abdde6786db0f89 (diff) | |
download | rails-ae6b46f00b5b8b2939c6b37ce3329c83de7e71db.tar.gz rails-ae6b46f00b5b8b2939c6b37ce3329c83de7e71db.tar.bz2 rails-ae6b46f00b5b8b2939c6b37ce3329c83de7e71db.zip |
Document AttributeAssignmentError and MultiparameterAssignmentErrors.
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 4cf5b41261..2cfdfd8c2c 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -92,13 +92,15 @@ module ActiveRecord #:nodoc: class DangerousAttributeError < ActiveRecordError end - # Raised when you've tried to access a column which wasn't - # loaded by your finder. Typically this is because <tt>:select</tt> - # has been specified. + # Raised when you've tried to access a column which wasn't loaded by your finder. + # Typically this is because <tt>:select</tt> has been specified. class MissingAttributeError < NoMethodError end - class AttributeAssignmentError < ActiveRecordError #:nodoc: + # Raised when an error occured while doing a mass assignment to an attribute through the + # +attributes=+ method. The exception has an +attribute+ property that is the name of the + # offending attribute. + class AttributeAssignmentError < ActiveRecordError attr_reader :exception, :attribute def initialize(message, exception, attribute) @exception = exception @@ -107,7 +109,10 @@ module ActiveRecord #:nodoc: end end - class MultiparameterAssignmentErrors < ActiveRecordError #:nodoc: + # Raised when there are multiple errors while doing a mass assignment through the +attributes+ + # method. The exception has an +errors+ property that contains an array of +AttributeAssignmentError+ + # objects, each corresponding to the error while assigning to an attribute. + class MultiparameterAssignmentErrors < ActiveRecordError attr_reader :errors def initialize(errors) @errors = errors |