From 55a205c552a4815c692355ca6bcf087524ebae92 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Sun, 6 Mar 2016 09:55:56 +0900 Subject: make attributes API example to work [ci skip] There is a need to pass the keyword arguments to `attribute` method. --- activerecord/lib/active_record/attributes.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib') 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")) -- cgit v1.2.3