Skip to content
This repository
Browse code

fixing documentation

  • Loading branch information...
commit 74f7e172c7a660286bfd2b265e299c55078fc68e 1 parent 4dc2521
Neeraj Singh authored August 03, 2010
4  activemodel/lib/active_model/errors.rb
@@ -37,11 +37,11 @@ module ActiveModel
37 37
   #       send(attr)
38 38
   #     end
39 39
   #   
40  
-  #     def ErrorsPerson.human_attribute_name(attr, options = {})
  40
+  #     def Person.human_attribute_name(attr, options = {})
41 41
   #       attr
42 42
   #     end
43 43
   #   
44  
-  #     def ErrorsPerson.lookup_ancestors
  44
+  #     def Person.lookup_ancestors
45 45
   #       [self]
46 46
   #     end
47 47
   #   
18  activerecord/lib/active_record/base.rb
@@ -516,7 +516,8 @@ def count_by_sql(sql)
516 516
         connection.select_value(sql, "#{name} Count").to_i
517 517
       end
518 518
 
519  
-      # Attributes listed as readonly can be set for a new record, but will be ignored in database updates afterwards.
  519
+      # Attributes listed as readonly will be used to create a new record but update operations will
  520
+      # ignore these fields.
520 521
       def attr_readonly(*attributes)
521 522
         write_inheritable_attribute(:attr_readonly, Set.new(attributes.map(&:to_s)) + (readonly_attributes || []))
522 523
       end
@@ -604,8 +605,8 @@ def full_table_name_prefix #:nodoc:
604 605
         (parents.detect{ |p| p.respond_to?(:table_name_prefix) } || self).table_name_prefix
605 606
       end
606 607
 
607  
-      # Defines the column name for use with single table inheritance
608  
-      # -- can be set in subclasses like so: self.inheritance_column = "type_id"
  608
+      # Defines the column name for use with single table inheritance. Use 
  609
+      # <tt>set_inheritance_column</tt> to set a different value.
609 610
       def inheritance_column
610 611
         @inheritance_column ||= "type".freeze
611 612
       end
@@ -622,8 +623,8 @@ def reset_sequence_name #:nodoc:
622 623
         default
623 624
       end
624 625
 
625  
-      # Sets the table name to use to the given value, or (if the value
626  
-      # is nil or false) to the value returned by the given block.
  626
+      # Sets the table name. If the value is nil or false  then the value returned by the given 
  627
+      # block is used.
627 628
       #
628 629
       #   class Project < ActiveRecord::Base
629 630
       #     set_table_name "project"
@@ -1034,8 +1035,8 @@ def all_attributes_exists?(attribute_names)
1034 1035
         end
1035 1036
 
1036 1037
       protected
1037  
-        # Scope parameters to method calls within the block.  Takes a hash of method_name => parameters hash.
1038  
-        # method_name may be <tt>:find</tt> or <tt>:create</tt>. <tt>:find</tt> parameter is <tt>Relation</tt> while
  1038
+        # with_scope lets you apply options to inner block incrementally. It takes a hash and the keys must be
  1039
+        # <tt>:find</tt> or <tt>:create</tt>. <tt>:find</tt> parameter is <tt>Relation</tt> while
1039 1040
         # <tt>:create</tt> parameters are an attributes hash.
1040 1041
         #
1041 1042
         #   class Article < ActiveRecord::Base
@@ -1080,8 +1081,7 @@ def all_attributes_exists?(attribute_names)
1080 1081
         #     end
1081 1082
         #   end
1082 1083
         #
1083  
-        # *Note*: the +:find+ scope also has effect on update and deletion methods,
1084  
-        # like +update_all+ and +delete_all+.
  1084
+        # *Note*: the +:find+ scope also has effect on update and deletion methods, like +update_all+ and +delete_all+.
1085 1085
         def with_scope(method_scoping = {}, action = :merge, &block)
1086 1086
           method_scoping = method_scoping.method_scoping if method_scoping.respond_to?(:method_scoping)
1087 1087
 
4  activerecord/lib/active_record/callbacks.rb
@@ -68,8 +68,8 @@ module ActiveRecord
68 68
   #   end
69 69
   #
70 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:
  71
+  # run, both +destroy_author+ and +destroy_readers+ are called. Contrast this to the following situation 
  72
+  # where the +before_destroy+ methis is overriden:
73 73
   #
74 74
   #   class Topic < ActiveRecord::Base
75 75
   #     def before_destroy() destroy_author end
2  activerecord/lib/active_record/counter_cache.rb
... ...
@@ -1,7 +1,7 @@
1 1
 module ActiveRecord
2 2
   # = Active Record Counter Cache
3 3
   module CounterCache
4  
-    # Resets one or more counter caches to their correct value using an SQL
  4
+    # Resets one or more counter caches to their correct value using a SQL
5 5
     # count query.  This is useful when adding new counter caches, or if the
6 6
     # counter has been corrupted or modified directly by SQL.
7 7
     #

0 notes on commit 74f7e17

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