diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-03-06 09:55:56 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-03-06 09:56:41 +0900 |
commit | 55a205c552a4815c692355ca6bcf087524ebae92 (patch) | |
tree | 5cdaca3153892402023e76165fe3ddc965e4a213 /activerecord | |
parent | 403c57aec052d60431dbae57eedae471d548dd01 (diff) | |
download | rails-55a205c552a4815c692355ca6bcf087524ebae92.tar.gz rails-55a205c552a4815c692355ca6bcf087524ebae92.tar.bz2 rails-55a205c552a4815c692355ca6bcf087524ebae92.zip |
make attributes API example to work [ci skip]
There is a need to pass the keyword arguments to `attribute` method.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/attributes.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/attributes.rb b/activerecord/lib/active_record/attributes.rb index 50a74ab18a..e0ceafc617 100644 --- a/activerecord/lib/active_record/attributes.rb +++ b/activerecord/lib/active_record/attributes.rb @@ -154,7 +154,7 @@ module ActiveRecord # end # # class MoneyType < Type::Value - # def initialize(currency_converter) + # def initialize(currency_converter:) # @currency_converter = currency_converter # end # @@ -171,7 +171,7 @@ module ActiveRecord # # class Product < ActiveRecord::Base # currency_converter = ConversionRatesFromTheInternet.new - # attribute :price_in_bitcoins, :money, currency_converter + # attribute :price_in_bitcoins, :money, currency_converter: currency_converter # end # # Product.where(price_in_bitcoins: Money.new(5, "USD")) |