mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove unused/missing to_money
converter in the test/doc
This commit is contained in:
parent
3cf0973bc7
commit
a9c6c3a23e
2 changed files with 2 additions and 3 deletions
|
@ -212,8 +212,7 @@ module ActiveRecord
|
||||||
#
|
#
|
||||||
# Option examples:
|
# Option examples:
|
||||||
# composed_of :temperature, mapping: %w(reading celsius)
|
# composed_of :temperature, mapping: %w(reading celsius)
|
||||||
# composed_of :balance, class_name: "Money", mapping: %w(balance amount),
|
# composed_of :balance, class_name: "Money", mapping: %w(balance amount)
|
||||||
# converter: Proc.new { |balance| balance.to_money }
|
|
||||||
# composed_of :address, mapping: [ %w(address_street street), %w(address_city city) ]
|
# composed_of :address, mapping: [ %w(address_street street), %w(address_city city) ]
|
||||||
# composed_of :gps_location
|
# composed_of :gps_location
|
||||||
# composed_of :gps_location, allow_nil: true
|
# composed_of :gps_location, allow_nil: true
|
||||||
|
|
|
@ -4,7 +4,7 @@ class Customer < ActiveRecord::Base
|
||||||
cattr_accessor :gps_conversion_was_run
|
cattr_accessor :gps_conversion_was_run
|
||||||
|
|
||||||
composed_of :address, mapping: [ %w(address_street street), %w(address_city city), %w(address_country country) ], allow_nil: true
|
composed_of :address, mapping: [ %w(address_street street), %w(address_city city), %w(address_country country) ], allow_nil: true
|
||||||
composed_of :balance, class_name: "Money", mapping: %w(balance amount), converter: Proc.new(&:to_money)
|
composed_of :balance, class_name: "Money", mapping: %w(balance amount)
|
||||||
composed_of :gps_location, allow_nil: true
|
composed_of :gps_location, allow_nil: true
|
||||||
composed_of :non_blank_gps_location, class_name: "GpsLocation", allow_nil: true, mapping: %w(gps_location gps_location),
|
composed_of :non_blank_gps_location, class_name: "GpsLocation", allow_nil: true, mapping: %w(gps_location gps_location),
|
||||||
converter: lambda { |gps| self.gps_conversion_was_run = true; gps.blank? ? nil : GpsLocation.new(gps) }
|
converter: lambda { |gps| self.gps_conversion_was_run = true; gps.blank? ? nil : GpsLocation.new(gps) }
|
||||||
|
|
Loading…
Reference in a new issue