Skip to content
This repository
Browse code

Document AttributeAssignmentError and MultiparameterAssignmentErrors.

  • Loading branch information...
commit ae6b46f00b5b8b2939c6b37ce3329c83de7e71db 1 parent aca44bc
Cheah Chu Yeow authored May 07, 2008

Showing 1 changed file with 10 additions and 5 deletions. Show diff stats Hide diff stats

  1. 15  activerecord/lib/active_record/base.rb
15  activerecord/lib/active_record/base.rb
@@ -92,13 +92,15 @@ class Rollback < ActiveRecordError
92 92
   class DangerousAttributeError < ActiveRecordError
93 93
   end
94 94
 
95  
-  # Raised when you've tried to access a column which wasn't
96  
-  # loaded by your finder.  Typically this is because <tt>:select</tt>
97  
-  # has been specified.
  95
+  # Raised when you've tried to access a column which wasn't loaded by your finder.
  96
+  # Typically this is because <tt>:select</tt> has been specified.
98 97
   class MissingAttributeError < NoMethodError
99 98
   end
100 99
 
101  
-  class AttributeAssignmentError < ActiveRecordError #:nodoc:
  100
+  # Raised when an error occured while doing a mass assignment to an attribute through the
  101
+  # +attributes=+ method. The exception has an +attribute+ property that is the name of the
  102
+  # offending attribute.
  103
+  class AttributeAssignmentError < ActiveRecordError
102 104
     attr_reader :exception, :attribute
103 105
     def initialize(message, exception, attribute)
104 106
       @exception = exception
@@ -107,7 +109,10 @@ def initialize(message, exception, attribute)
107 109
     end
108 110
   end
109 111
 
110  
-  class MultiparameterAssignmentErrors < ActiveRecordError #:nodoc:
  112
+  # Raised when there are multiple errors while doing a mass assignment through the +attributes+
  113
+  # method. The exception has an +errors+ property that contains an array of +AttributeAssignmentError+
  114
+  # objects, each corresponding to the error while assigning to an attribute.
  115
+  class MultiparameterAssignmentErrors < ActiveRecordError
111 116
     attr_reader :errors
112 117
     def initialize(errors)
113 118
       @errors = errors

0 notes on commit ae6b46f

Please sign in to comment.
Something went wrong with that request. Please try again.