Skip to content
Browse files

revised font of constants in Active Record

  • Loading branch information...
1 parent e5a7423 commit fb1858d5ecd808f9abdcb2f56ee61702d5076bf6 @fxn fxn committed May 21, 2008
View
18 activerecord/lib/active_record/aggregations.rb
@@ -92,19 +92,19 @@ def clear_aggregation_cache #:nodoc:
#
# == Writing value objects
#
- # Value objects are immutable and interchangeable objects that represent a given value, such as a +Money+ object representing
- # $5. Two +Money+ objects both representing $5 should be equal (through methods such as == and <=> from +Comparable+ if ranking
- # makes sense). This is unlike entity objects where equality is determined by identity. An entity class such as +Customer+ can
+ # Value objects are immutable and interchangeable objects that represent a given value, such as a Money object representing
+ # $5. Two Money objects both representing $5 should be equal (through methods such as <tt>==</tt> and <tt><=></tt> from Comparable if ranking
+ # makes sense). This is unlike entity objects where equality is determined by identity. An entity class such as Customer can
# easily have two different objects that both have an address on Hyancintvej. Entity identity is determined by object or
- # relational unique identifiers (such as primary keys). Normal <tt>ActiveRecord::Base</tt> classes are entity objects.
+ # relational unique identifiers (such as primary keys). Normal ActiveRecord::Base 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
+ # 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 Money#exchanged_to 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.
#
# The immutable requirement is enforced by Active Record by freezing any object assigned as a value object. Attempting to
- # change it afterwards will result in a <tt>ActiveSupport::FrozenObjectError</tt>.
+ # change it afterwards will result in a ActiveSupport::FrozenObjectError.
#
# Read more about value objects on http://c2.com/cgi/wiki?ValueObject and on the dangers of not keeping value objects
# immutable on http://c2.com/cgi/wiki?ValueObjectsShouldBeImmutable
@@ -123,8 +123,8 @@ module ClassMethods
#
# Options are:
# * <tt>:class_name</tt> - specify the class name of the association. Use it only if that name can't be inferred
- # from the part id. So <tt>composed_of :address</tt> will by default be linked to the +Address+ class, but
- # if the real class name is +CompanyAddress+, you'll have to specify it with this option.
+ # from the part id. So <tt>composed_of :address</tt> will by default be linked to the Address class, but
+ # if the real class name is CompanyAddress, you'll have to specify it with this option.
# * <tt>:mapping</tt> - specifies a number of mapping arrays (attribute, parameter) that bind an attribute name
# to a constructor parameter on the value class.
# * <tt>:allow_nil</tt> - specifies that the aggregate object will not be instantiated when all mapped
View
2 activerecord/lib/active_record/associations.rb
@@ -950,7 +950,7 @@ def belongs_to(association_id, options = {})
#
# Deprecated: Any additional fields added to the join table will be placed as attributes when pulling records out through
# +has_and_belongs_to_many+ associations. Records returned from join tables with additional attributes will be marked as
- # +ReadOnly+ (because we can't save changes to the additional attributes). It's strongly recommended that you upgrade any
+ # readonly (because we can't save changes to the additional attributes). It's strongly recommended that you upgrade any
# associations with attributes to a real join model (see introduction).
#
# Adds the following methods for retrieval and query:
View
6 activerecord/lib/active_record/base.rb
@@ -70,7 +70,7 @@ class PreparedStatementInvalid < ActiveRecordError
# instantiation, for example, when two users edit the same wiki page and one starts editing and saves
# the page before the other.
#
- # Read more about optimistic locking in +ActiveRecord::Locking+ module RDoc.
+ # Read more about optimistic locking in ActiveRecord::Locking module RDoc.
class StaleObjectError < ActiveRecordError
end
@@ -407,7 +407,7 @@ def self.reset_subclasses #:nodoc:
@@table_name_suffix = ""
# Indicates whether table names should be the pluralized versions of the corresponding class names.
- # If true, the default table name for a +Product+ class will be +products+. If false, it would just be +product+.
+ # If true, the default table name for a Product class will be +products+. If false, it would just be +product+.
# See table_name for the full rules on table/class naming. This is true, by default.
cattr_accessor :pluralize_table_names, :instance_writer => false
@@pluralize_table_names = true
@@ -943,7 +943,7 @@ def readonly_attributes
# If you have an attribute that needs to be saved to the database as an object, and retrieved as the same object,
# then specify the name of that attribute using this method and it will be handled automatically.
# The serialization is done through YAML. If +class_name+ is specified, the serialized object must be of that
- # class on retrieval or +SerializationTypeMismatch+ will be raised.
+ # class on retrieval or SerializationTypeMismatch will be raised.
#
# ==== Attributes
#

0 comments on commit fb1858d

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