mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix the example of 'finding records by a value object' (#31818)
This example was added in abdf546ad6
but was inconsistent with `composed_of :balance` definition in the
'Customer'.
[Ryuta Kamizono & bogdanvlviv]
[ci skip]
This commit is contained in:
parent
798da629ce
commit
133dc3b6d0
1 changed files with 2 additions and 2 deletions
|
@ -177,9 +177,9 @@ module ActiveRecord
|
|||
#
|
||||
# Once a #composed_of relationship is specified for a model, records can be loaded from the database
|
||||
# by specifying an instance of the value object in the conditions hash. The following example
|
||||
# finds all customers with +balance_amount+ equal to 20 and +balance_currency+ equal to "USD":
|
||||
# finds all customers with +address_street+ equal to "May Street" and +address_city+ equal to "Chicago":
|
||||
#
|
||||
# Customer.where(balance: Money.new(20, "USD"))
|
||||
# Customer.where(address: Address.new("May Street", "Chicago"))
|
||||
#
|
||||
module ClassMethods
|
||||
# Adds reader and writer methods for manipulating a value object:
|
||||
|
|
Loading…
Reference in a new issue