aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2008-05-19 21:31:18 +0200
committerXavier Noria <fxn@hashref.com>2008-05-19 21:31:18 +0200
commit78596747bae784196da7a184a33ef5d1b2a94107 (patch)
treeb94130ebf2866af3ffbbfbdeca6ff64fd97366b2
parent67603693b5933d825fb17036394fe913e6edde8e (diff)
downloadrails-78596747bae784196da7a184a33ef5d1b2a94107.tar.gz
rails-78596747bae784196da7a184a33ef5d1b2a94107.tar.bz2
rails-78596747bae784196da7a184a33ef5d1b2a94107.zip
#method vs +method+ in Active Record
-rw-r--r--activerecord/lib/active_record/aggregations.rb2
-rwxr-xr-xactiverecord/lib/active_record/base.rb6
-rw-r--r--activerecord/lib/active_record/calculations.rb8
-rwxr-xr-xactiverecord/lib/active_record/callbacks.rb2
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb4
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb4
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb2
-rw-r--r--activerecord/lib/active_record/locking/optimistic.rb14
-rw-r--r--activerecord/lib/active_record/migration.rb2
-rw-r--r--activerecord/lib/active_record/observer.rb2
-rw-r--r--activerecord/lib/active_record/schema.rb4
-rw-r--r--activerecord/lib/active_record/serializers/xml_serializer.rb6
-rwxr-xr-xactiverecord/lib/active_record/validations.rb4
13 files changed, 30 insertions, 30 deletions
diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb
index 61446cde36..a8c8c7f3dc 100644
--- a/activerecord/lib/active_record/aggregations.rb
+++ b/activerecord/lib/active_record/aggregations.rb
@@ -99,7 +99,7 @@ module ActiveRecord
# relational unique identifiers (such as primary keys). Normal <tt>ActiveRecord::Base</tt> classes are entity objects.
#
# It's also important to treat the value objects as immutable. Don't allow the +Money+ object to have its amount changed after
- # creation. Create a new +Money+ object with the new value instead. This is exemplified by the <tt>Money#exchanged_to</tt> method that
+ # creation. Create a new Money object with the new value instead. This is exemplified by the <tt>Money#exchanged_to</tt> method that
# returns a new value object instead of changing its own values. Active Record won't persist value objects that have been
# changed through means other than the writer method.
#
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 6f9d5e53f5..35f18e9fa0 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1277,7 +1277,7 @@ module ActiveRecord #:nodoc:
class_of_active_record_descendant(self)
end
- # Set this to true if this is an abstract class (see #abstract_class?).
+ # Set this to true if this is an abstract class (see <tt>abstract_class?</tt>).
attr_accessor :abstract_class
# Returns whether this class is a base AR class. If A is a base class and
@@ -1724,8 +1724,8 @@ module ActiveRecord #:nodoc:
end
- # Defines an "attribute" method (like #inheritance_column or
- # #table_name). A new (class) method will be created with the
+ # Defines an "attribute" method (like +inheritance_column+ or
+ # +table_name+). A new (class) method will be created with the
# given name. If a value is specified, the new method will
# return that value (as a string). Otherwise, the given block
# will be used to compute the value of the method.
diff --git a/activerecord/lib/active_record/calculations.rb b/activerecord/lib/active_record/calculations.rb
index 3c5caefe3b..fec9bee38f 100644
--- a/activerecord/lib/active_record/calculations.rb
+++ b/activerecord/lib/active_record/calculations.rb
@@ -46,28 +46,28 @@ module ActiveRecord
calculate(:count, *construct_count_options_from_args(*args))
end
- # Calculates the average value on a given column. The value is returned as a float. See #calculate for examples with options.
+ # Calculates the average value on a given column. The value is returned as a float. See +calculate+ for examples with options.
#
# Person.average('age')
def average(column_name, options = {})
calculate(:avg, column_name, options)
end
- # Calculates the minimum value on a given column. The value is returned with the same data type of the column. See #calculate for examples with options.
+ # Calculates the minimum value on a given column. The value is returned with the same data type of the column. See +calculate+ for examples with options.
#
# Person.minimum('age')
def minimum(column_name, options = {})
calculate(:min, column_name, options)
end
- # Calculates the maximum value on a given column. The value is returned with the same data type of the column. See #calculate for examples with options.
+ # Calculates the maximum value on a given column. The value is returned with the same data type of the column. See +calculate+ for examples with options.
#
# Person.maximum('age')
def maximum(column_name, options = {})
calculate(:max, column_name, options)
end
- # Calculates the sum of values on a given column. The value is returned with the same data type of the column. See #calculate for examples with options.
+ # Calculates the sum of values on a given column. The value is returned with the same data type of the column. See +calculate+ for examples with options.
#
# Person.sum('age')
def sum(column_name, options = {})
diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb
index a469af682b..41ec5c5e61 100755
--- a/activerecord/lib/active_record/callbacks.rb
+++ b/activerecord/lib/active_record/callbacks.rb
@@ -161,7 +161,7 @@ module ActiveRecord
# == <tt>before_validation*</tt> returning statements
#
# 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+.
- # If <tt>Base#save!</tt> is called it will raise a +RecordNotSaved+ exception.
+ # If Base#save! is called it will raise a RecordNotSaved exception.
# Nothing will be appended to the errors object.
#
# == Canceling callbacks
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
index 589acd3945..16d405d3bd 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -29,7 +29,7 @@ module ActiveRecord
end
# Returns an array of arrays containing the field values.
- # Order is the same as that returned by #columns.
+ # Order is the same as that returned by +columns+.
def select_rows(sql, name = nil)
raise NotImplementedError, "select_rows is an abstract method"
end
@@ -93,7 +93,7 @@ module ActiveRecord
# done if the transaction block raises an exception or returns false.
def rollback_db_transaction() end
- # Alias for #add_limit_offset!.
+ # Alias for <tt>add_limit_offset!</tt>.
def add_limit!(sql, options)
add_limit_offset!(sql, options) if options
end
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
index fdb18b234c..18f1175f5f 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -270,7 +270,7 @@ module ActiveRecord
end
# Represents a SQL table in an abstract way.
- # Columns are stored as a ColumnDefinition in the #columns attribute.
+ # Columns are stored as a ColumnDefinition in the +columns+ attribute.
class TableDefinition
attr_accessor :columns
@@ -395,7 +395,7 @@ module ActiveRecord
# end
#
# There's a short-hand method for each of the type values declared at the top. And then there's
- # TableDefinition#timestamps that'll add created_at and updated_at as datetimes.
+ # TableDefinition#timestamps that'll add created_at and +updated_at+ as datetimes.
#
# TableDefinition#references will add an appropriately-named _id column, plus a corresponding _type
# column if the <tt>:polymorphic</tt> option is supplied. If <tt>:polymorphic</tt> is a hash of options, these will be
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index ac24e920fe..01e128f02f 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -32,7 +32,7 @@ module ActiveRecord
def columns(table_name, name = nil) end
# Creates a new table
- # There are two ways to work with #create_table. You can use the block
+ # There are two ways to work with +create_table+. You can use the block
# form or the regular form, like this:
#
# === Block form
diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb
index 65f88cfdc7..c66034d18b 100644
--- a/activerecord/lib/active_record/locking/optimistic.rb
+++ b/activerecord/lib/active_record/locking/optimistic.rb
@@ -107,20 +107,20 @@ module ActiveRecord
end
# Is optimistic locking enabled for this table? Returns true if the
- # #lock_optimistically flag is set to true (which it is, by default)
- # and the table includes the #locking_column column (defaults to
- # lock_version).
+ # +lock_optimistically+ flag is set to true (which it is, by default)
+ # and the table includes the +locking_column+ column (defaults to
+ # +lock_version+).
def locking_enabled?
lock_optimistically && columns_hash[locking_column]
end
- # Set the column to use for optimistic locking. Defaults to lock_version.
+ # Set the column to use for optimistic locking. Defaults to +lock_version+.
def set_locking_column(value = nil, &block)
define_attr_method :locking_column, value, &block
value
end
- # The version column used for optimistic locking. Defaults to lock_version.
+ # The version column used for optimistic locking. Defaults to +lock_version+.
def locking_column
reset_locking_column
end
@@ -130,12 +130,12 @@ module ActiveRecord
connection.quote_column_name(locking_column)
end
- # Reset the column used for optimistic locking back to the lock_version default.
+ # Reset the column used for optimistic locking back to the +lock_version+ default.
def reset_locking_column
set_locking_column DEFAULT_LOCKING_COLUMN
end
- # make sure the lock version column gets updated when counters are
+ # Make sure the lock version column gets updated when counters are
# updated.
def update_counters_with_lock(id, counters)
counters = counters.merge(locking_column => 1) if locking_enabled?
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb
index 5cc9f4e197..df512a996a 100644
--- a/activerecord/lib/active_record/migration.rb
+++ b/activerecord/lib/active_record/migration.rb
@@ -208,7 +208,7 @@ module ActiveRecord
#
# You can quiet them down by setting ActiveRecord::Migration.verbose = false.
#
- # You can also insert your own messages and benchmarks by using the #say_with_time
+ # You can also insert your own messages and benchmarks by using the +say_with_time+
# method:
#
# def self.up
diff --git a/activerecord/lib/active_record/observer.rb b/activerecord/lib/active_record/observer.rb
index 2b0728fc25..45e4d5b704 100644
--- a/activerecord/lib/active_record/observer.rb
+++ b/activerecord/lib/active_record/observer.rb
@@ -19,7 +19,7 @@ module ActiveRecord
# # Same as above, just using explicit class references
# ActiveRecord::Base.observers = Cacher, GarbageCollector
#
- # Note: Setting this does not instantiate the observers yet. #instantiate_observers is
+ # Note: Setting this does not instantiate the observers yet. +instantiate_observers+ is
# called during startup, and before each development request.
def observers=(*observers)
@observers = observers.flatten
diff --git a/activerecord/lib/active_record/schema.rb b/activerecord/lib/active_record/schema.rb
index d6b254fcf9..8a32cf1ca2 100644
--- a/activerecord/lib/active_record/schema.rb
+++ b/activerecord/lib/active_record/schema.rb
@@ -30,8 +30,8 @@ module ActiveRecord
# Eval the given block. All methods available to the current connection
# adapter are available within the block, so you can easily use the
- # database definition DSL to build up your schema (#create_table,
- # #add_index, etc.).
+ # database definition DSL to build up your schema (+create_table+,
+ # +add_index+, etc.).
#
# The +info+ hash is optional, and if given is used to define metadata
# about the current schema (currently, only the schema's version):
diff --git a/activerecord/lib/active_record/serializers/xml_serializer.rb b/activerecord/lib/active_record/serializers/xml_serializer.rb
index 2d0887ecf0..d171b742f5 100644
--- a/activerecord/lib/active_record/serializers/xml_serializer.rb
+++ b/activerecord/lib/active_record/serializers/xml_serializer.rb
@@ -273,14 +273,14 @@ module ActiveRecord #:nodoc:
end
# There is a significant speed improvement if the value
- # does not need to be escaped, as #tag! escapes all values
+ # does not need to be escaped, as <tt>tag!</tt> escapes all values
# to ensure that valid XML is generated. For known binary
# values, it is at least an order of magnitude faster to
# Base64 encode binary values and directly put them in the
# output XML than to pass the original value or the Base64
- # encoded value to the #tag! method. It definitely makes
+ # encoded value to the <tt>tag!</tt> method. It definitely makes
# no sense to Base64 encode the value and then give it to
- # #tag!, since that just adds additional overhead.
+ # <tt>tag!</tt>, since that just adds additional overhead.
def needs_encoding?
![ :binary, :date, :datetime, :boolean, :float, :integer ].include?(type)
end
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index b3a75121ed..0e150bddb2 100755
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -301,7 +301,7 @@ module ActiveRecord
:odd => 'odd?', :even => 'even?' }.freeze
# Adds a validation method or block to the class. This is useful when
- # overriding the #validate instance method becomes too unwieldly and
+ # overriding the +validate+ instance method becomes too unwieldly and
# you're looking for more descriptive declaration of your validations.
#
# This can be done with a symbol pointing to a method:
@@ -326,7 +326,7 @@ module ActiveRecord
# end
# end
#
- # This usage applies to #validate_on_create and #validate_on_update as well.
+ # This usage applies to +validate_on_create+ and +validate_on_update+ as well.
# Validates each attribute against a block.
#