Skip to content
This repository
Browse code

ensuring that description does not exceed 100 columns

  • Loading branch information...
commit 1ce40ca56216ae76e93cde78ec2752de110400c0 1 parent b8d9d9c
Neeraj Singh authored

Showing 19 changed files with 205 additions and 138 deletions. Show diff stats Hide diff stats

  1. 7  activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
  2. 7  activerecord/lib/active_record/associations/has_many_through_association.rb
  3. 3  activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
  4. 4  activerecord/lib/active_record/attribute_methods/write.rb
  5. 66  activerecord/lib/active_record/callbacks.rb
  6. 10  activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
  7. 3  activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
  8. 12  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
  9. 4  activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
  10. 14  activerecord/lib/active_record/errors.rb
  11. 50  activerecord/lib/active_record/fixtures.rb
  12. 21  activerecord/lib/active_record/named_scope.rb
  13. 4  activerecord/lib/active_record/observer.rb
  14. 4  activerecord/lib/active_record/persistence.rb
  15. 79  activerecord/lib/active_record/relation/calculations.rb
  16. 23  activerecord/lib/active_record/relation/finder_methods.rb
  17. 3  activerecord/lib/active_record/timestamp.rb
  18. 7  activerecord/lib/active_record/validations/associated.rb
  19. 22  activerecord/lib/active_record/validations/uniqueness.rb
7  activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
@@ -106,9 +106,10 @@ def construct_scope
106 106
                         :limit => @reflection.options[:limit] } }
107 107
         end
108 108
 
109  
-        # Join tables with additional columns on top of the two foreign keys must be considered ambiguous unless a select
110  
-        # clause has been explicitly defined. Otherwise you can get broken records back, if, for example, the join column also has
111  
-        # an id column. This will then overwrite the id column of the records coming back.
  109
+        # Join tables with additional columns on top of the two foreign keys must be considered 
  110
+        # ambiguous unless a select clause has been explicitly defined. Otherwise you can get 
  111
+        # broken records back, if, for example, the join column also has an id column. This will 
  112
+        # then overwrite the id column of the records coming back.
112 113
         def finding_with_ambiguous_select?(select_clause)
113 114
           !select_clause && columns.size != 2
114 115
         end
7  activerecord/lib/active_record/associations/has_many_through_association.rb
@@ -24,9 +24,10 @@ def destroy(*records)
24 24
         end
25 25
       end
26 26
 
27  
-      # Returns the size of the collection by executing a SELECT COUNT(*) query if the collection hasn't been loaded and
28  
-      # calling collection.size if it has. If it's more likely than not that the collection does have a size larger than zero,
29  
-      # and you need to fetch that collection afterwards, it'll take one fewer SELECT query if you use #length.
  27
+      # Returns the size of the collection by executing a SELECT COUNT(*) query if the collection hasn't been 
  28
+      # loaded and calling collection.size if it has. If it's more likely than not that the collection does 
  29
+      # have a size larger than zero, and you need to fetch that collection afterwards, it'll take one fewer 
  30
+      # SELECT query if you use #length.
30 31
       def size
31 32
         return @owner.send(:read_attribute, cached_counter_attribute_name) if has_cached_counter?
32 33
         return @target.size if loaded?
3  activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
@@ -14,7 +14,8 @@ module TimeZoneConversion
14 14
       module ClassMethods
15 15
         protected
16 16
           # Defined for all +datetime+ and +timestamp+ attributes when +time_zone_aware_attributes+ are enabled.
17  
-          # This enhanced read method automatically converts the UTC time stored in the database to the time zone stored in Time.zone.
  17
+          # This enhanced read method automatically converts the UTC time stored in the database to the time 
  18
+          # zone stored in Time.zone.
18 19
           def define_method_attribute(attr_name)
19 20
             if create_time_zone_conversion_attribute?(attr_name, columns_hash[attr_name])
20 21
               method_body, line = <<-EOV, __LINE__ + 1
4  activerecord/lib/active_record/attribute_methods/write.rb
@@ -14,8 +14,8 @@ def define_method_attribute=(attr_name)
14 14
           end
15 15
       end
16 16
 
17  
-      # Updates the attribute identified by <tt>attr_name</tt> with the specified +value+. Empty strings for fixnum and float
18  
-      # columns are turned into +nil+.
  17
+      # Updates the attribute identified by <tt>attr_name</tt> with the specified +value+. Empty strings 
  18
+      # for fixnum and float columns are turned into +nil+.
19 19
       def write_attribute(attr_name, value)
20 20
         attr_name = attr_name.to_s
21 21
         attr_name = self.class.primary_key if attr_name == 'id'
66  activerecord/lib/active_record/callbacks.rb
@@ -26,8 +26,8 @@ module ActiveRecord
26 26
   # <tt>after_rollback</tt>.
27 27
   #
28 28
   # That's a total of ten callbacks, which gives you immense power to react and prepare for each state in the
29  
-  # Active Record lifecycle. The sequence for calling <tt>Base#save</tt> for an existing record is similar, except that each
30  
-  # <tt>_on_create</tt> callback is replaced by the corresponding <tt>_on_update</tt> callback.
  29
+  # Active Record lifecycle. The sequence for calling <tt>Base#save</tt> for an existing record is similar, 
  30
+  # except that each <tt>_on_create</tt> callback is replaced by the corresponding <tt>_on_update</tt> callback.
31 31
   #
32 32
   # Examples:
33 33
   #   class CreditCard < ActiveRecord::Base
@@ -55,9 +55,9 @@ module ActiveRecord
55 55
   #
56 56
   # == Inheritable callback queues
57 57
   #
58  
-  # Besides the overwritable callback methods, it's also possible to register callbacks through the use of the callback macros.
59  
-  # Their main advantage is that the macros add behavior into a callback queue that is kept intact down through an inheritance
60  
-  # hierarchy. Example:
  58
+  # Besides the overwritable callback methods, it's also possible to register callbacks through the 
  59
+  # use of the callback macros. Their main advantage is that the macros add behavior into a callback 
  60
+  # queue that is kept intact down through an inheritance hierarchy.
61 61
   #
62 62
   #   class Topic < ActiveRecord::Base
63 63
   #     before_destroy :destroy_author
@@ -67,9 +67,9 @@ module ActiveRecord
67 67
   #     before_destroy :destroy_readers
68 68
   #   end
69 69
   #
70  
-  # Now, when <tt>Topic#destroy</tt> is run only +destroy_author+ is called. When <tt>Reply#destroy</tt> is run, both +destroy_author+ and
71  
-  # +destroy_readers+ are called. Contrast this to the situation where we've implemented the save behavior through overwriteable
72  
-  # methods:
  70
+  # Now, when <tt>Topic#destroy</tt> is run only +destroy_author+ is called. When <tt>Reply#destroy</tt> is 
  71
+  # run, both +destroy_author+ and +destroy_readers+ are called. Contrast this to the situation where 
  72
+  # we've implemented the save behavior through overwriteable methods:
73 73
   #
74 74
   #   class Topic < ActiveRecord::Base
75 75
   #     def before_destroy() destroy_author end
@@ -79,20 +79,21 @@ module ActiveRecord
79 79
   #     def before_destroy() destroy_readers end
80 80
   #   end
81 81
   #
82  
-  # In that case, <tt>Reply#destroy</tt> would only run +destroy_readers+ and _not_ +destroy_author+. So, use the callback macros when
83  
-  # you want to ensure that a certain callback is called for the entire hierarchy, and use the regular overwriteable methods
84  
-  # when you want to leave it up to each descendant to decide whether they want to call +super+ and trigger the inherited callbacks.
  82
+  # In that case, <tt>Reply#destroy</tt> would only run +destroy_readers+ and _not_ +destroy_author+. 
  83
+  # So, use the callback macros when you want to ensure that a certain callback is called for the entire 
  84
+  # hierarchy, and use the regular overwriteable methods when you want to leave it up to each descendant 
  85
+  # to decide whether they want to call +super+ and trigger the inherited callbacks.
85 86
   #
86  
-  # *IMPORTANT:* In order for inheritance to work for the callback queues, you must specify the callbacks before specifying the
87  
-  # associations. Otherwise, you might trigger the loading of a child before the parent has registered the callbacks and they won't
88  
-  # be inherited.
  87
+  # *IMPORTANT:* In order for inheritance to work for the callback queues, you must specify the 
  88
+  # callbacks before specifying the associations. Otherwise, you might trigger the loading of a 
  89
+  # child before the parent has registered the callbacks and they won't be inherited.
89 90
   #
90 91
   # == Types of callbacks
91 92
   #
92 93
   # There are four types of callbacks accepted by the callback macros: Method references (symbol), callback objects,
93  
-  # inline methods (using a proc), and inline eval methods (using a string). Method references and callback objects are the
94  
-  # recommended approaches, inline methods using a proc are sometimes appropriate (such as for creating mix-ins), and inline
95  
-  # eval methods are deprecated.
  94
+  # inline methods (using a proc), and inline eval methods (using a string). Method references and callback objects 
  95
+  # are the recommended approaches, inline methods using a proc are sometimes appropriate (such as for 
  96
+  # creating mix-ins), and inline eval methods are deprecated.
96 97
   #
97 98
   # The method reference callbacks work by specifying a protected or private method available in the object, like this:
98 99
   #
@@ -169,15 +170,15 @@ module ActiveRecord
169 170
   #       end
170 171
   #   end
171 172
   #
172  
-  # The callback macros usually accept a symbol for the method they're supposed to run, but you can also pass a "method string",
173  
-  # which will then be evaluated within the binding of the callback. Example:
  173
+  # The callback macros usually accept a symbol for the method they're supposed to run, but you can also 
  174
+  # pass a "method string", which will then be evaluated within the binding of the callback. Example:
174 175
   #
175 176
   #   class Topic < ActiveRecord::Base
176 177
   #     before_destroy 'self.class.delete_all "parent_id = #{id}"'
177 178
   #   end
178 179
   #
179  
-  # Notice that single quotes (') are used so the <tt>#{id}</tt> part isn't evaluated until the callback is triggered. Also note that these
180  
-  # inline callbacks can be stacked just like the regular ones:
  180
+  # Notice that single quotes (') are used so the <tt>#{id}</tt> part isn't evaluated until the callback 
  181
+  # is triggered. Also note that these inline callbacks can be stacked just like the regular ones:
181 182
   #
182 183
   #   class Topic < ActiveRecord::Base
183 184
   #     before_destroy 'self.class.delete_all "parent_id = #{id}"',
@@ -186,22 +187,24 @@ module ActiveRecord
186 187
   #
187 188
   # == The +after_find+ and +after_initialize+ exceptions
188 189
   #
189  
-  # Because +after_find+ and +after_initialize+ are called for each object found and instantiated by a finder, such as <tt>Base.find(:all)</tt>, we've had
190  
-  # to implement a simple performance constraint (50% more speed on a simple test case). Unlike all the other callbacks, +after_find+ and
191  
-  # +after_initialize+ will only be run if an explicit implementation is defined (<tt>def after_find</tt>). In that case, all of the
  190
+  # Because +after_find+ and +after_initialize+ are called for each object found and instantiated by a finder, 
  191
+  # such as <tt>Base.find(:all)</tt>, we've had to implement a simple performance constraint (50% more speed 
  192
+  # on a simple test case). Unlike all the other callbacks, +after_find+ and +after_initialize+ will only be 
  193
+  # run if an explicit implementation is defined (<tt>def after_find</tt>). In that case, all of the
192 194
   # callback types will be called.
193 195
   #
194 196
   # == <tt>before_validation*</tt> returning statements
195 197
   #
196  
-  # If the returning value of a +before_validation+ callback can be evaluated to +false+, the process will be aborted and <tt>Base#save</tt> will return +false+.
197  
-  # If Base#save! is called it will raise a ActiveRecord::RecordInvalid exception.
198  
-  # Nothing will be appended to the errors object.
  198
+  # If the returning value of a +before_validation+ callback can be evaluated to +false+, the process will be 
  199
+  # aborted and <tt>Base#save</tt> will return +false+. If Base#save! is called it will raise a 
  200
+  # ActiveRecord::RecordInvalid exception. Nothing will be appended to the errors object.
199 201
   #
200 202
   # == Canceling callbacks
201 203
   #
202  
-  # If a <tt>before_*</tt> callback returns +false+, all the later callbacks and the associated action are cancelled. If an <tt>after_*</tt> callback returns
203  
-  # +false+, all the later callbacks are cancelled. Callbacks are generally run in the order they are defined, with the exception of callbacks
204  
-  # defined as methods on the model, which are called last.
  204
+  # If a <tt>before_*</tt> callback returns +false+, all the later callbacks and the associated action are 
  205
+  # cancelled. If an <tt>after_*</tt> callback returns +false+, all the later callbacks are cancelled. 
  206
+  # Callbacks are generally run in the order they are defined, with the exception of callbacks defined as 
  207
+  # methods on the model, which are called last.
205 208
   #
206 209
   # == Transactions
207 210
   #
@@ -217,7 +220,8 @@ module ActiveRecord
217 220
   #
218 221
   # == Debugging callbacks
219 222
   #
220  
-  # To list the methods and procs registered with a particular callback, append <tt>_callback_chain</tt> to the callback name that you wish to list and send that to your class from the Rails console:
  223
+  # To list the methods and procs registered with a particular callback, append <tt>_callback_chain</tt> to 
  224
+  # the callback name that you wish to list and send that to your class from the Rails console:
221 225
   #
222 226
   #   >> Topic.after_save_callback_chain
223 227
   #   => [#<ActiveSupport::Callbacks::Callback:0x3f6a448
10  activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -23,7 +23,8 @@ module Format
23 23
       #
24 24
       # +name+ is the column's name, such as <tt>supplier_id</tt> in <tt>supplier_id int(11)</tt>.
25 25
       # +default+ is the type-casted default value, such as +new+ in <tt>sales_stage varchar(20) default 'new'</tt>.
26  
-      # +sql_type+ is used to extract the column's length, if necessary. For example +60+ in <tt>company_name varchar(60)</tt>.
  26
+      # +sql_type+ is used to extract the column's length, if necessary. For example +60+ in 
  27
+      # <tt>company_name varchar(60)</tt>.
27 28
       # It will be mapped to one of the standard Rails SQL types in the <tt>type</tt> attribute.
28 29
       # +null+ determines if this column allows +NULL+ values.
29 30
       def initialize(name, default, sql_type = nil, null = true)
@@ -359,7 +360,8 @@ def [](name)
359 360
       #
360 361
       # Available options are (none of these exists by default):
361 362
       # * <tt>:limit</tt> -
362  
-      #   Requests a maximum column length. This is number of characters for <tt>:string</tt> and <tt>:text</tt> columns and number of bytes for :binary and :integer columns.
  363
+      #   Requests a maximum column length. This is number of characters for <tt>:string</tt> and 
  364
+      #   <tt>:text</tt> columns and number of bytes for :binary and :integer columns.
363 365
       # * <tt>:default</tt> -
364 366
       #   The column's default value. Use nil for NULL.
365 367
       # * <tt>:null</tt> -
@@ -462,8 +464,8 @@ def [](name)
462 464
       # TableDefinition#timestamps that'll add created_at and +updated_at+ as datetimes.
463 465
       #
464 466
       # TableDefinition#references will add an appropriately-named _id column, plus a corresponding _type
465  
-      # column if the <tt>:polymorphic</tt> option is supplied. If <tt>:polymorphic</tt> is a hash of options, these will be
466  
-      # used when creating the <tt>_type</tt> column. So what can be written like this:
  467
+      # column if the <tt>:polymorphic</tt> option is supplied. If <tt>:polymorphic</tt> is a hash of 
  468
+      # options, these will be used when creating the <tt>_type</tt> column. So what can be written like this:
467 469
       #
468 470
       #   create_table :taggings do |t|
469 471
       #     t.integer :tag_id, :tagger_id, :taggable_id
3  activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -278,7 +278,8 @@ def select_rows(sql, name = nil)
278 278
         rows
279 279
       end
280 280
 
281  
-      # Executes a SQL query and returns a MySQL::Result object. Note that you have to free the Result object after you're done using it.
  281
+      # Executes a SQL query and returns a MySQL::Result object. Note that you have to free 
  282
+      # the Result object after you're done using it.
282 283
       def execute(sql, name = nil) #:nodoc:
283 284
         if name == :skip_logging
284 285
           @connection.query(sql)
12  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -183,10 +183,14 @@ module ConnectionAdapters
183 183
     # * <tt>:username</tt> - Defaults to nothing.
184 184
     # * <tt>:password</tt> - Defaults to nothing.
185 185
     # * <tt>:database</tt> - The name of the database. No default, must be provided.
186  
-    # * <tt>:schema_search_path</tt> - An optional schema search path for the connection given as a string of comma-separated schema names.  This is backward-compatible with the <tt>:schema_order</tt> option.
187  
-    # * <tt>:encoding</tt> - An optional client encoding that is used in a <tt>SET client_encoding TO <encoding></tt> call on the connection.
188  
-    # * <tt>:min_messages</tt> - An optional client min messages that is used in a <tt>SET client_min_messages TO <min_messages></tt> call on the connection.
189  
-    # * <tt>:allow_concurrency</tt> - If true, use async query methods so Ruby threads don't deadlock; otherwise, use blocking query methods.
  186
+    # * <tt>:schema_search_path</tt> - An optional schema search path for the connection given 
  187
+    #   as a string of comma-separated schema names.  This is backward-compatible with the <tt>:schema_order</tt> option.
  188
+    # * <tt>:encoding</tt> - An optional client encoding that is used in a <tt>SET client_encoding TO 
  189
+    #   <encoding></tt> call on the connection.
  190
+    # * <tt>:min_messages</tt> - An optional client min messages that is used in a 
  191
+    #   <tt>SET client_min_messages TO <min_messages></tt> call on the connection.
  192
+    # * <tt>:allow_concurrency</tt> - If true, use async query methods so Ruby threads don't deadlock; 
  193
+    #   otherwise, use blocking query methods.
190 194
     class PostgreSQLAdapter < AbstractAdapter
191 195
       ADAPTER_NAME = 'PostgreSQL'.freeze
192 196
 
4  activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -29,8 +29,8 @@ def binary_to_string(value)
29 29
       end
30 30
     end
31 31
 
32  
-    # The SQLite adapter works with both the 2.x and 3.x series of SQLite with the sqlite-ruby drivers (available both as gems and
33  
-    # from http://rubyforge.org/projects/sqlite-ruby/).
  32
+    # The SQLite adapter works with both the 2.x and 3.x series of SQLite with the sqlite-ruby 
  33
+    # drivers (available both as gems and from http://rubyforge.org/projects/sqlite-ruby/).
34 34
     #
35 35
     # Options:
36 36
     #
14  activerecord/lib/active_record/errors.rb
@@ -30,7 +30,8 @@ class AssociationTypeMismatch < ActiveRecordError
30 30
   class SerializationTypeMismatch < ActiveRecordError
31 31
   end
32 32
 
33  
-  # Raised when adapter not specified on connection (or configuration file <tt>config/database.yml</tt> misses adapter field).
  33
+  # Raised when adapter not specified on connection (or configuration file <tt>config/database.yml</tt> 
  34
+  # misses adapter field).
34 35
   class AdapterNotSpecified < ActiveRecordError
35 36
   end
36 37
 
@@ -38,7 +39,8 @@ class AdapterNotSpecified < ActiveRecordError
38 39
   class AdapterNotFound < ActiveRecordError
39 40
   end
40 41
 
41  
-  # Raised when connection to the database could not been established (for example when <tt>connection=</tt> is given a nil object).
  42
+  # Raised when connection to the database could not been established (for example when <tt>connection=</tt> 
  43
+  # is given a nil object).
42 44
   class ConnectionNotEstablished < ActiveRecordError
43 45
   end
44 46
 
@@ -51,7 +53,8 @@ class RecordNotFound < ActiveRecordError
51 53
   class RecordNotSaved < ActiveRecordError
52 54
   end
53 55
 
54  
-  # Raised when SQL statement cannot be executed by the database (for example, it's often the case for MySQL when Ruby driver used is too old).
  56
+  # Raised when SQL statement cannot be executed by the database (for example, it's often the case for 
  57
+  # MySQL when Ruby driver used is too old).
55 58
   class StatementInvalid < ActiveRecordError
56 59
   end
57 60
 
@@ -78,7 +81,8 @@ class RecordNotUnique < WrappedDatabaseException
78 81
   class InvalidForeignKey < WrappedDatabaseException
79 82
   end
80 83
 
81  
-  # Raised when number of bind variables in statement given to <tt>:condition</tt> key (for example, when using +find+ method)
  84
+  # Raised when number of bind variables in statement given to <tt>:condition</tt> key (for example, 
  85
+  # when using +find+ method)
82 86
   # does not match number of expected variables.
83 87
   #
84 88
   # For example, in
@@ -165,4 +169,4 @@ def initialize(errors)
165 169
       @errors = errors
166 170
     end
167 171
   end
168  
-end
  172
+end
50  activerecord/lib/active_record/fixtures.rb
@@ -39,9 +39,10 @@ class FixtureClassNotFound < StandardError #:nodoc:
39 39
 # This type of fixture is in YAML format and the preferred default. YAML is a file format which describes data structures
40 40
 # in a non-verbose, human-readable format. It ships with Ruby 1.8.1+.
41 41
 #
42  
-# Unlike single-file fixtures, YAML fixtures are stored in a single file per model, which are placed in the directory appointed
43  
-# by <tt>ActiveSupport::TestCase.fixture_path=(path)</tt> (this is automatically configured for Rails, so you can just
44  
-# put your files in <tt><your-rails-app>/test/fixtures/</tt>). The fixture file ends with the <tt>.yml</tt> file extension (Rails example:
  42
+# Unlike single-file fixtures, YAML fixtures are stored in a single file per model, which are placed 
  43
+# in the directory appointed by <tt>ActiveSupport::TestCase.fixture_path=(path)</tt> (this is 
  44
+# automatically configured for Rails, so you can just put your files in <tt><your-rails-app>/test/fixtures/</tt>). 
  45
+# The fixture file ends with the <tt>.yml</tt> file extension (Rails example:
45 46
 # <tt><your-rails-app>/test/fixtures/web_sites.yml</tt>). The format of a YAML fixture file looks like this:
46 47
 #
47 48
 #   rubyonrails:
@@ -58,7 +59,8 @@ class FixtureClassNotFound < StandardError #:nodoc:
58 59
 # indented list of key/value pairs in the "key: value" format.  Records are separated by a blank line for your viewing
59 60
 # pleasure.
60 61
 #
61  
-# Note that YAML fixtures are unordered. If you want ordered fixtures, use the omap YAML type.  See http://yaml.org/type/omap.html
  62
+# Note that YAML fixtures are unordered. If you want ordered fixtures, use the omap YAML type.  
  63
+# See http://yaml.org/type/omap.html
62 64
 # for the specification.  You will need ordered fixtures when you have foreign key constraints on keys in the same table.
63 65
 # This is commonly needed for tree structures.  Example:
64 66
 #
@@ -79,7 +81,8 @@ class FixtureClassNotFound < StandardError #:nodoc:
79 81
 # (Rails example: <tt><your-rails-app>/test/fixtures/web_sites.csv</tt>).
80 82
 #
81 83
 # The format of this type of fixture file is much more compact than the others, but also a little harder to read by us
82  
-# humans.  The first line of the CSV file is a comma-separated list of field names.  The rest of the file is then comprised
  84
+# humans.  The first line of the CSV file is a comma-separated list of field names.  The rest of the 
  85
+# file is then comprised
83 86
 # of the actual data (1 per line).  Here's an example:
84 87
 #
85 88
 #   id, name, url
@@ -99,15 +102,16 @@ class FixtureClassNotFound < StandardError #:nodoc:
99 102
 #
100 103
 # == Single-file fixtures
101 104
 #
102  
-# This type of fixture was the original format for Active Record that has since been deprecated in favor of the YAML and CSV formats.
103  
-# Fixtures for this format are created by placing text files in a sub-directory (with the name of the model) to the directory
104  
-# appointed by <tt>ActiveSupport::TestCase.fixture_path=(path)</tt> (this is automatically configured for Rails, so you can just
105  
-# put your files in <tt><your-rails-app>/test/fixtures/<your-model-name>/</tt> --
  105
+# This type of fixture was the original format for Active Record that has since been deprecated in 
  106
+# favor of the YAML and CSV formats.
  107
+# Fixtures for this format are created by placing text files in a sub-directory (with the name of the model) 
  108
+# to the directory appointed by <tt>ActiveSupport::TestCase.fixture_path=(path)</tt> (this is automatically 
  109
+# configured for Rails, so you can just put your files in <tt><your-rails-app>/test/fixtures/<your-model-name>/</tt> --
106 110
 # like <tt><your-rails-app>/test/fixtures/web_sites/</tt> for the WebSite model).
107 111
 #
108 112
 # Each text file placed in this directory represents a "record".  Usually these types of fixtures are named without
109  
-# extensions, but if you are on a Windows machine, you might consider adding <tt>.txt</tt> as the extension.  Here's what the
110  
-# above example might look like:
  113
+# extensions, but if you are on a Windows machine, you might consider adding <tt>.txt</tt> as the extension.  
  114
+# Here's what the above example might look like:
111 115
 #
112 116
 #   web_sites/google
113 117
 #   web_sites/yahoo.txt
@@ -133,7 +137,8 @@ class FixtureClassNotFound < StandardError #:nodoc:
133 137
 #     end
134 138
 #   end
135 139
 #
136  
-# By default, the <tt>test_helper module</tt> will load all of your fixtures into your test database, so this test will succeed.
  140
+# By default, the <tt>test_helper module</tt> will load all of your fixtures into your test database, 
  141
+# so this test will succeed.
137 142
 # The testing environment will automatically load the all fixtures into the database before each test.
138 143
 # To ensure consistent data, the environment deletes the fixtures before running the load.
139 144
 #
@@ -182,13 +187,15 @@ class FixtureClassNotFound < StandardError #:nodoc:
182 187
 # This will create 1000 very simple YAML fixtures.
183 188
 #
184 189
 # Using ERb, you can also inject dynamic values into your fixtures with inserts like <tt><%= Date.today.strftime("%Y-%m-%d") %></tt>.
185  
-# This is however a feature to be used with some caution. The point of fixtures are that they're stable units of predictable
186  
-# sample data. If you feel that you need to inject dynamic values, then perhaps you should reexamine whether your application
187  
-# is properly testable. Hence, dynamic values in fixtures are to be considered a code smell.
  190
+# This is however a feature to be used with some caution. The point of fixtures are that they're 
  191
+# stable units of predictable sample data. If you feel that you need to inject dynamic values, then 
  192
+# perhaps you should reexamine whether your application is properly testable. Hence, dynamic values 
  193
+# in fixtures are to be considered a code smell.
188 194
 #
189 195
 # = Transactional fixtures
190 196
 #
191  
-# TestCases can use begin+rollback to isolate their changes to the database instead of having to delete+insert for every test case.
  197
+# TestCases can use begin+rollback to isolate their changes to the database instead of having to 
  198
+# delete+insert for every test case.
192 199
 #
193 200
 #   class FooTest < ActiveSupport::TestCase
194 201
 #     self.use_transactional_fixtures = true
@@ -205,15 +212,18 @@ class FixtureClassNotFound < StandardError #:nodoc:
205 212
 #   end
206 213
 #
207 214
 # If you preload your test database with all fixture data (probably in the Rakefile task) and use transactional fixtures,
208  
-# then you may omit all fixtures declarations in your test cases since all the data's already there and every case rolls back its changes.
  215
+# then you may omit all fixtures declarations in your test cases since all the data's already there 
  216
+# and every case rolls back its changes.
209 217
 #
210 218
 # In order to use instantiated fixtures with preloaded data, set +self.pre_loaded_fixtures+ to true. This will provide
211  
-# access to fixture data for every table that has been loaded through fixtures (depending on the value of +use_instantiated_fixtures+)
  219
+# access to fixture data for every table that has been loaded through fixtures (depending on the 
  220
+# value of +use_instantiated_fixtures+)
212 221
 #
213 222
 # When *not* to use transactional fixtures:
214 223
 #
215  
-# 1. You're testing whether a transaction works correctly. Nested transactions don't commit until all parent transactions commit,
216  
-#    particularly, the fixtures transaction which is begun in setup and rolled back in teardown. Thus, you won't be able to verify
  224
+# 1. You're testing whether a transaction works correctly. Nested transactions don't commit until 
  225
+#    all parent transactions commit, particularly, the fixtures transaction which is begun in setup 
  226
+#    and rolled back in teardown. Thus, you won't be able to verify
217 227
 #    the results of your transaction until Active Record supports nested transactions or savepoints (in progress).
218 228
 # 2. Your database does not support transactions. Every Active Record database supports transactions except MySQL MyISAM.
219 229
 #    Use InnoDB, MaxDB, or NDB instead.
21  activerecord/lib/active_record/named_scope.rb
@@ -48,18 +48,21 @@ def scopes
48 48
       # The above calls to <tt>scope</tt> define class methods Shirt.red and Shirt.dry_clean_only. Shirt.red,
49 49
       # in effect, represents the query <tt>Shirt.where(:color => 'red')</tt>.
50 50
       #
51  
-      # Unlike <tt>Shirt.find(...)</tt>, however, the object returned by Shirt.red is not an Array; it resembles the association object
52  
-      # constructed by a <tt>has_many</tt> declaration. For instance, you can invoke <tt>Shirt.red.first</tt>, <tt>Shirt.red.count</tt>,
53  
-      # <tt>Shirt.red.where(:size => 'small')</tt>. Also, just as with the association objects, named \scopes act like an Array,
54  
-      # implementing Enumerable; <tt>Shirt.red.each(&block)</tt>, <tt>Shirt.red.first</tt>, and <tt>Shirt.red.inject(memo, &block)</tt>
  51
+      # Unlike <tt>Shirt.find(...)</tt>, however, the object returned by Shirt.red is not an Array; it 
  52
+      # resembles the association object constructed by a <tt>has_many</tt> declaration. For instance, 
  53
+      # you can invoke <tt>Shirt.red.first</tt>, <tt>Shirt.red.count</tt>, <tt>Shirt.red.where(:size => 'small')</tt>. 
  54
+      # Also, just as with the association objects, named \scopes act like an Array, implementing Enumerable; 
  55
+      # <tt>Shirt.red.each(&block)</tt>, <tt>Shirt.red.first</tt>, and <tt>Shirt.red.inject(memo, &block)</tt>
55 56
       # all behave as if Shirt.red really was an Array.
56 57
       #
57  
-      # These named \scopes are composable. For instance, <tt>Shirt.red.dry_clean_only</tt> will produce all shirts that are both red and dry clean only.
58  
-      # Nested finds and calculations also work with these compositions: <tt>Shirt.red.dry_clean_only.count</tt> returns the number of garments
59  
-      # for which these criteria obtain. Similarly with <tt>Shirt.red.dry_clean_only.average(:thread_count)</tt>.
  58
+      # These named \scopes are composable. For instance, <tt>Shirt.red.dry_clean_only</tt> will produce 
  59
+      # all shirts that are both red and dry clean only.
  60
+      # Nested finds and calculations also work with these compositions: <tt>Shirt.red.dry_clean_only.count</tt> 
  61
+      # returns the number of garments for which these criteria obtain. Similarly with 
  62
+      # <tt>Shirt.red.dry_clean_only.average(:thread_count)</tt>.
60 63
       #
61  
-      # All \scopes are available as class methods on the ActiveRecord::Base descendant upon which the \scopes were defined. But they are also available to
62  
-      # <tt>has_many</tt> associations. If,
  64
+      # All \scopes are available as class methods on the ActiveRecord::Base descendant upon which 
  65
+      # the \scopes were defined. But they are also available to <tt>has_many</tt> associations. If,
63 66
       #
64 67
       #   class Person < ActiveRecord::Base
65 68
       #     has_many :shirts
4  activerecord/lib/active_record/observer.rb
@@ -67,8 +67,8 @@ module ActiveRecord
67 67
   #
68 68
   # == Configuration
69 69
   #
70  
-  # In order to activate an observer, list it in the <tt>config.active_record.observers</tt> configuration setting in your
71  
-  # <tt>config/application.rb</tt> file.
  70
+  # In order to activate an observer, list it in the <tt>config.active_record.observers</tt> configuration 
  71
+  # setting in your <tt>config/application.rb</tt> file.
72 72
   #
73 73
   #   config.active_record.observers = :comment_observer, :signup_observer
74 74
   #
4  activerecord/lib/active_record/persistence.rb
@@ -91,8 +91,8 @@ def destroy
91 91
     # like render <tt>:partial => @client.becomes(Company)</tt> to render that
92 92
     # instance using the companies/company partial instead of clients/client.
93 93
     #
94  
-    # Note: The new instance will share a link to the same attributes as the original class. So any change to the attributes in either
95  
-    # instance will affect the other.
  94
+    # Note: The new instance will share a link to the same attributes as the original class. 
  95
+    # So any change to the attributes in either instance will affect the other.
96 96
     def becomes(klass)
97 97
       became = klass.new
98 98
       became.instance_variable_set("@attributes", @attributes)
79  activerecord/lib/active_record/relation/calculations.rb
@@ -5,26 +5,33 @@ module Calculations
5 5
     # Count operates using three different approaches.
6 6
     #
7 7
     # * Count all: By not passing any parameters to count, it will return a count of all the rows for the model.
8  
-    # * Count using column: By passing a column name to count, it will return a count of all the rows for the model with supplied column present
  8
+    # * Count using column: By passing a column name to count, it will return a count of all the 
  9
+    #   rows for the model with supplied column present
9 10
     # * Count using options will find the row count matched by the options used.
10 11
     #
11 12
     # The third approach, count using options, accepts an option hash as the only parameter. The options are:
12 13
     #
13  
-    # * <tt>:conditions</tt>: An SQL fragment like "administrator = 1" or [ "user_name = ?", username ]. See conditions in the intro to ActiveRecord::Base.
  14
+    # * <tt>:conditions</tt>: An SQL fragment like "administrator = 1" or [ "user_name = ?", username ]. 
  15
+    #   See conditions in the intro to ActiveRecord::Base.
14 16
     # * <tt>:joins</tt>: Either an SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id" (rarely needed)
15  
-    #   or named associations in the same form used for the <tt>:include</tt> option, which will perform an INNER JOIN on the associated table(s).
16  
-    #   If the value is a string, then the records will be returned read-only since they will have attributes that do not correspond to the table's columns.
  17
+    #   or named associations in the same form used for the <tt>:include</tt> option, which will 
  18
+    #   perform an INNER JOIN on the associated table(s).
  19
+    #   If the value is a string, then the records will be returned read-only since they will have 
  20
+    #   attributes that do not correspond to the table's columns.
17 21
     #   Pass <tt>:readonly => false</tt> to override.
18  
-    # * <tt>:include</tt>: Named associations that should be loaded alongside using LEFT OUTER JOINs. The symbols named refer
19  
-    #   to already defined associations. When using named associations, count returns the number of DISTINCT items for the model you're counting.
  22
+    # * <tt>:include</tt>: Named associations that should be loaded alongside using LEFT OUTER JOINs. 
  23
+    #   The symbols named refer to already defined associations. When using named associations, count 
  24
+    #   returns the number of DISTINCT items for the model you're counting.
20 25
     #   See eager loading under Associations.
21 26
     # * <tt>:order</tt>: An SQL fragment like "created_at DESC, name" (really only used with GROUP BY calculations).
22 27
     # * <tt>:group</tt>: An attribute name by which the result should be grouped. Uses the GROUP BY SQL-clause.
23  
-    # * <tt>:select</tt>: By default, this is * as in SELECT * FROM, but can be changed if you, for example, want to do a join but not
  28
+    # * <tt>:select</tt>: By default, this is * as in SELECT * FROM, but can be changed if you, for example, 
  29
+    #   want to do a join but not
24 30
     #   include the joined columns.
25  
-    # * <tt>:distinct</tt>: Set this to true to make this a distinct calculation, such as SELECT COUNT(DISTINCT posts.id) ...
26  
-    # * <tt>:from</tt> - By default, this is the table name of the class, but can be changed to an alternate table name (or even the name
27  
-    #   of a database view).
  31
+    # * <tt>:distinct</tt>: Set this to true to make this a distinct calculation, such as 
  32
+    #   SELECT COUNT(DISTINCT posts.id) ...
  33
+    # * <tt>:from</tt> - By default, this is the table name of the class, but can be changed to an 
  34
+    #   alternate table name (or even the name of a database view).
28 35
     #
29 36
     # Examples for counting all:
30 37
     #   Person.count         # returns the total count of all people
@@ -34,12 +41,19 @@ module Calculations
34 41
     #
35 42
     # Examples for count with options:
36 43
     #   Person.count(:conditions => "age > 26")
37  
-    #   Person.count(:conditions => "age > 26 AND job.salary > 60000", :include => :job) # because of the named association, it finds the DISTINCT count using LEFT OUTER JOIN.
38  
-    #   Person.count(:conditions => "age > 26 AND job.salary > 60000", :joins => "LEFT JOIN jobs on jobs.person_id = person.id") # finds the number of rows matching the conditions and joins.
  44
+    #
  45
+    #   # because of the named association, it finds the DISTINCT count using LEFT OUTER JOIN.
  46
+    #   Person.count(:conditions => "age > 26 AND job.salary > 60000", :include => :job) 
  47
+    #
  48
+    #   # finds the number of rows matching the conditions and joins.
  49
+    #   Person.count(:conditions => "age > 26 AND job.salary > 60000", 
  50
+    #                :joins => "LEFT JOIN jobs on jobs.person_id = person.id") 
  51
+    #
39 52
     #   Person.count('id', :conditions => "age > 26") # Performs a COUNT(id)
40 53
     #   Person.count(:all, :conditions => "age > 26") # Performs a COUNT(*) (:all is an alias for '*')
41 54
     #
42  
-    # Note: <tt>Person.count(:all)</tt> will not work because it will use <tt>:all</tt> as the condition.  Use Person.count instead.
  55
+    # Note: <tt>Person.count(:all)</tt> will not work because it will use <tt>:all</tt> as the condition.  
  56
+    # Use Person.count instead.
43 57
     def count(column_name = nil, options = {})
44 58
       column_name, options = nil, column_name if column_name.is_a?(Hash)
45 59
       calculate(:count, column_name, options)
@@ -80,13 +94,15 @@ def sum(column_name, options = {})
80 94
       calculate(:sum, column_name, options)
81 95
     end
82 96
 
83  
-    # This calculates aggregate values in the given column.  Methods for count, sum, average, minimum, and maximum have been added as shortcuts.
84  
-    # Options such as <tt>:conditions</tt>, <tt>:order</tt>, <tt>:group</tt>, <tt>:having</tt>, and <tt>:joins</tt> can be passed to customize the query.
  97
+    # This calculates aggregate values in the given column.  Methods for count, sum, average, 
  98
+    # minimum, and maximum have been added as shortcuts. Options such as <tt>:conditions</tt>, 
  99
+    # <tt>:order</tt>, <tt>:group</tt>, <tt>:having</tt>, and <tt>:joins</tt> can be passed to customize the query.
85 100
     #
86 101
     # There are two basic forms of output:
87  
-    #   * Single aggregate value: The single value is type cast to Fixnum for COUNT, Float for AVG, and the given column's type for everything else.
88  
-    #   * Grouped values: This returns an ordered hash of the values and groups them by the <tt>:group</tt> option.  It takes either a column name, or the name
89  
-    #     of a belongs_to association.
  102
+    #   * Single aggregate value: The single value is type cast to Fixnum for COUNT, Float 
  103
+    #     for AVG, and the given column's type for everything else.
  104
+    #   * Grouped values: This returns an ordered hash of the values and groups them by the 
  105
+    #     <tt>:group</tt> option.  It takes either a column name, or the name of a belongs_to association.
90 106
     #
91 107
     #       values = Person.maximum(:age, :group => 'last_name')
92 108
     #       puts values["Drake"]
@@ -102,21 +118,30 @@ def sum(column_name, options = {})
102 118
     #       end
103 119
     #
104 120
     # Options:
105  
-    # * <tt>:conditions</tt> - An SQL fragment like "administrator = 1" or [ "user_name = ?", username ]. See conditions in the intro to ActiveRecord::Base.
106  
-    # * <tt>:include</tt>: Eager loading, see Associations for details.  Since calculations don't load anything, the purpose of this is to access fields on joined tables in your conditions, order, or group clauses.
107  
-    # * <tt>:joins</tt> - An SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id". (Rarely needed).
108  
-    #   The records will be returned read-only since they will have attributes that do not correspond to the table's columns.
  121
+    # * <tt>:conditions</tt> - An SQL fragment like "administrator = 1" or [ "user_name = ?", username ]. 
  122
+    #   See conditions in the intro to ActiveRecord::Base.
  123
+    # * <tt>:include</tt>: Eager loading, see Associations for details.  Since calculations don't load anything, 
  124
+    #   the purpose of this is to access fields on joined tables in your conditions, order, or group clauses.
  125
+    # * <tt>:joins</tt> - An SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id". 
  126
+    #   (Rarely needed).
  127
+    #   The records will be returned read-only since they will have attributes that do not correspond to the 
  128
+    #   table's columns.
109 129
     # * <tt>:order</tt> - An SQL fragment like "created_at DESC, name" (really only used with GROUP BY calculations).
110 130
     # * <tt>:group</tt> - An attribute name by which the result should be grouped. Uses the GROUP BY SQL-clause.
111  
-    # * <tt>:select</tt> - By default, this is * as in SELECT * FROM, but can be changed if you for example want to do a join, but not
112  
-    #   include the joined columns.
113  
-    # * <tt>:distinct</tt> - Set this to true to make this a distinct calculation, such as SELECT COUNT(DISTINCT posts.id) ...
  131
+    # * <tt>:select</tt> - By default, this is * as in SELECT * FROM, but can be changed if you for example 
  132
+    #   want to do a join, but not include the joined columns.
  133
+    # * <tt>:distinct</tt> - Set this to true to make this a distinct calculation, such as 
  134
+    #   SELECT COUNT(DISTINCT posts.id) ...
114 135
     #
115 136
     # Examples:
116 137
     #   Person.calculate(:count, :all) # The same as Person.count
117 138
     #   Person.average(:age) # SELECT AVG(age) FROM people...
118  
-    #   Person.minimum(:age, :conditions => ['last_name != ?', 'Drake']) # Selects the minimum age for everyone with a last name other than 'Drake'
119  
-    #   Person.minimum(:age, :having => 'min(age) > 17', :group => :last_name) # Selects the minimum age for any family without any minors
  139
+    #   Person.minimum(:age, :conditions => ['last_name != ?', 'Drake']) # Selects the minimum age for 
  140
+    #                                                                    # everyone with a last name other than 'Drake'
  141
+    #
  142
+    #   # Selects the minimum age for any family without any minors
  143
+    #   Person.minimum(:age, :having => 'min(age) > 17', :group => :last_name) 
  144
+    #
120 145
     #   Person.sum("2 * age")
121 146
     def calculate(operation, column_name, options = {})
122 147
       if options.except(:distinct).present?
23  activerecord/lib/active_record/relation/finder_methods.rb
@@ -21,23 +21,28 @@ module FinderMethods
21 21
     #
22 22
     # ==== Parameters
23 23
     #
24  
-    # * <tt>:conditions</tt> - An SQL fragment like "administrator = 1", <tt>[ "user_name = ?", username ]</tt>, or <tt>["user_name = :user_name", { :user_name => user_name }]</tt>. See conditions in the intro.
  24
+    # * <tt>:conditions</tt> - An SQL fragment like "administrator = 1", <tt>[ "user_name = ?", username ]</tt>, 
  25
+    #   or <tt>["user_name = :user_name", { :user_name => user_name }]</tt>. See conditions in the intro.
25 26
     # * <tt>:order</tt> - An SQL fragment like "created_at DESC, name".
26 27
     # * <tt>:group</tt> - An attribute name by which the result should be grouped. Uses the <tt>GROUP BY</tt> SQL-clause.
27  
-    # * <tt>:having</tt> - Combined with +:group+ this can be used to filter the records that a <tt>GROUP BY</tt> returns. Uses the <tt>HAVING</tt> SQL-clause.
  28
+    # * <tt>:having</tt> - Combined with +:group+ this can be used to filter the records that a 
  29
+    #   <tt>GROUP BY</tt> returns. Uses the <tt>HAVING</tt> SQL-clause.
28 30
     # * <tt>:limit</tt> - An integer determining the limit on the number of rows that should be returned.
29  
-    # * <tt>:offset</tt> - An integer determining the offset from where the rows should be fetched. So at 5, it would skip rows 0 through 4.
  31
+    # * <tt>:offset</tt> - An integer determining the offset from where the rows should be fetched. So at 5, 
  32
+    #   it would skip rows 0 through 4.
30 33
     # * <tt>:joins</tt> - Either an SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id" (rarely needed),
31  
-    #   named associations in the same form used for the <tt>:include</tt> option, which will perform an <tt>INNER JOIN</tt> on the associated table(s),
  34
+    #   named associations in the same form used for the <tt>:include</tt> option, which will perform an 
  35
+    #   <tt>INNER JOIN</tt> on the associated table(s),
32 36
     #   or an array containing a mixture of both strings and named associations.
33  
-    #   If the value is a string, then the records will be returned read-only since they will have attributes that do not correspond to the table's columns.
  37
+    #   If the value is a string, then the records will be returned read-only since they will 
  38
+    #   have attributes that do not correspond to the table's columns.
34 39
     #   Pass <tt>:readonly => false</tt> to override.
35 40
     # * <tt>:include</tt> - Names associations that should be loaded alongside. The symbols named refer
36 41
     #   to already defined associations. See eager loading under Associations.
37  
-    # * <tt>:select</tt> - By default, this is "*" as in "SELECT * FROM", but can be changed if you, for example, want to do a join but not
38  
-    #   include the joined columns. Takes a string with the SELECT SQL fragment (e.g. "id, name").
39  
-    # * <tt>:from</tt> - By default, this is the table name of the class, but can be changed to an alternate table name (or even the name
40  
-    #   of a database view).
  42
+    # * <tt>:select</tt> - By default, this is "*" as in "SELECT * FROM", but can be changed if you, 
  43
+    #   for example, want to do a join but not include the joined columns. Takes a string with the SELECT SQL fragment (e.g. "id, name").
  44
+    # * <tt>:from</tt> - By default, this is the table name of the class, but can be changed 
  45
+    #   to an alternate table name (or even the name of a database view).
41 46
     # * <tt>:readonly</tt> - Mark the returned records read-only so they cannot be saved or updated.
42 47
     # * <tt>:lock</tt> - An SQL fragment like "FOR UPDATE" or "LOCK IN SHARE MODE".
43 48
     #   <tt>:lock => true</tt> gives connection's default exclusive lock, usually "FOR UPDATE".
3  activerecord/lib/active_record/timestamp.rb
@@ -21,7 +21,8 @@ module ActiveRecord
21 21
   #
22 22
   # This feature can easily be turned off by assigning value <tt>false</tt> .
23 23
   #
24  
-  # If your attributes are time zone aware and you desire to skip time zone conversion for certain attributes then you can do following:
  24
+  # If your attributes are time zone aware and you desire to skip time zone conversion for certain 
  25
+  # attributes then you can do following:
25 26
   #
26 27
   #   Topic.skip_time_zone_conversion_for_attributes = [:written_on]
27 28
   module Timestamp
7  activerecord/lib/active_record/validations/associated.rb
@@ -27,8 +27,9 @@ module ClassMethods
27 27
       #
28 28
       # this would specify a circular dependency and cause infinite recursion.
29 29
       #
30  
-      # NOTE: This validation will not fail if the association hasn't been assigned. If you want to ensure that the association
31  
-      # is both present and guaranteed to be valid, you also need to use +validates_presence_of+.
  30
+      # NOTE: This validation will not fail if the association hasn't been assigned. If you want to 
  31
+      # ensure that the association is both present and guaranteed to be valid, you also need to 
  32
+      # use +validates_presence_of+.
32 33
       #
33 34
       # Configuration options:
34 35
       # * <tt>:message</tt> - A custom error message (default is: "is invalid")
@@ -44,4 +45,4 @@ def validates_associated(*attr_names)
44 45
       end
45 46
     end
46 47
   end
47  
-end
  48
+end
22  activerecord/lib/active_record/validations/uniqueness.rb
@@ -78,22 +78,25 @@ def mount_sql_and_params(klass, table_name, attribute, value) #:nodoc:
78 78
     end
79 79
 
80 80
     module ClassMethods
81  
-      # Validates whether the value of the specified attributes are unique across the system. Useful for making sure that only one user
  81
+      # Validates whether the value of the specified attributes are unique across the system. 
  82
+      # Useful for making sure that only one user
82 83
       # can be named "davidhh".
83 84
       #
84 85
       #   class Person < ActiveRecord::Base
85 86
       #     validates_uniqueness_of :user_name, :scope => :account_id
86 87
       #   end
87 88
       #
88  
-      # It can also validate whether the value of the specified attributes are unique based on multiple scope parameters.  For example,
89  
-      # making sure that a teacher can only be on the schedule once per semester for a particular class.
  89
+      # It can also validate whether the value of the specified attributes are unique based on multiple 
  90
+      # scope parameters.  For example, making sure that a teacher can only be on the schedule once 
  91
+      # per semester for a particular class.
90 92
       #
91 93
       #   class TeacherSchedule < ActiveRecord::Base
92 94
       #     validates_uniqueness_of :teacher_id, :scope => [:semester_id, :class_id]
93 95
       #   end
94 96
       #
95  
-      # When the record is created, a check is performed to make sure that no record exists in the database with the given value for the specified
96  
-      # attribute (that maps to a column). When the record is updated, the same check is made but disregarding the record itself.
  97
+      # When the record is created, a check is performed to make sure that no record exists in the database 
  98
+      # with the given value for the specified attribute (that maps to a column). When the record is updated, 
  99
+      # the same check is made but disregarding the record itself.
97 100
       #
98 101
       # Configuration options:
99 102
       # * <tt>:message</tt> - Specifies a custom error message (default is: "has already been taken").
@@ -102,11 +105,12 @@ module ClassMethods
102 105
       # * <tt>:allow_nil</tt> - If set to true, skips this validation if the attribute is +nil+ (default is +false+).
103 106
       # * <tt>:allow_blank</tt> - If set to true, skips this validation if the attribute is blank (default is +false+).
104 107
       # * <tt>:if</tt> - Specifies a method, proc or string to call to determine if the validation should
105  
-      #   occur (e.g. <tt>:if => :allow_validation</tt>, or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>).  The
106  
-      #   method, proc or string should return or evaluate to a true or false value.
  108
+      #   occur (e.g. <tt>:if => :allow_validation</tt>, or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>).  
  109
+      #   The method, proc or string should return or evaluate to a true or false value.
107 110
       # * <tt>:unless</tt> - Specifies a method, proc or string to call to determine if the validation should
108  
-      #   not occur (e.g. <tt>:unless => :skip_validation</tt>, or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).  The
109  
-      #   method, proc or string should return or evaluate to a true or false value.
  111
+      #   not occur (e.g. <tt>:unless => :skip_validation</tt>, or 
  112
+      #   <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).  The method, proc or string should 
  113
+      #   return or evaluate to a true or false value.
110 114
       #
111 115
       # === Concurrency and integrity
112 116
       #

0 notes on commit 1ce40ca

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