1
0
Fork 0
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:
Ryuta Kamizono 2018-01-29 16:42:12 +09:00
parent 3cf0973bc7
commit a9c6c3a23e
2 changed files with 2 additions and 3 deletions

View file

@ -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

View file

@ -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) }