aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/aggregations.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-05-25 12:29:00 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-05-25 12:29:00 +0100
commit98dc582742779081e71e697fcdf8d9ae2b421b16 (patch)
treef5680eef86e689a10d0f75434ba6a4e94829e439 /activerecord/lib/active_record/aggregations.rb
parent6277fd91133a3566333612857510d74de60d67f4 (diff)
downloadrails-98dc582742779081e71e697fcdf8d9ae2b421b16.tar.gz
rails-98dc582742779081e71e697fcdf8d9ae2b421b16.tar.bz2
rails-98dc582742779081e71e697fcdf8d9ae2b421b16.zip
Merge docrails.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record/aggregations.rb')
-rw-r--r--activerecord/lib/active_record/aggregations.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb
index 61446cde36..a5d3a50ef1 100644
--- a/activerecord/lib/active_record/aggregations.rb
+++ b/activerecord/lib/active_record/aggregations.rb
@@ -92,19 +92,19 @@ module ActiveRecord
#
# == 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 ActiveRecord
#
# 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