2014/06/30分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Add Hash#map_values
to ActiveSupport
Merge pull request #15961 from mckramer/patch-1
actionview/lib/action_view/helpers/date_helper.rb
の修正です。
time_ago_in_words
メソッドの引数名を、適切な名前にリネームしています。
Quick pass through Active Support and guides CHANGELOG
activesupportとguideのCHANGELOGの修正です。
不要なスペース・改行を削除しています。
Tiny documentation fixes [ci skip]
actionview、activesupport、guideの各docの修正です。
exampleの変数名の修正、+
の追加等々。
Don't encourage usage of columns_hash
activerecord/lib/active_record/attribute_methods.rb
の修正です。
column_for_attribute
メソッドで指定されたカラム名が存在しなかった場合に、代わりにmodel.class.columns_hash[name]
を使うようwarningを出力していたのですが、直接hash参照するのはよくない、という事で代わりにattribute_exists?
を新規に作成して、こちらのメソッドを使うようwarningを修正しています。
Use the type object for sending JSON to the database
PostgreSQLのConnectionAdapterの修正です。
Cast
moduleで行っていたJSONの変換処理をtype配下のJson
クラスで処理を行うよう修正しています。
Add Hash#map_values
to ActiveSupport
Hash#transform_values
、Hash#transform_values!
メソッドを新規に作成しています。
{ a: 1, b: 2, c: 3 }.transform_values { |x| x * 2 } # => { a: 2, b: 4, c: 6 }
valueに対して、引数のブロックを実行した結果を設定するメソッドのようですね。keyは変わりません。!
破壊メソッド版。
Simplify creation of default attributes on AR instance
activerecord/lib/active_record/core.rb
の修正です。
initialize
メソッドでの@attributes
の生成処理をself.class.default_attributes.dup
に修正しています。
Use Hash#transform_values
to clean up AttributeSet
activerecord/lib/active_record/attribute_set.rb
の修正です。
早速先ほど追加されたHash#transform_values
メソッドを使用するよう修正しています。
Use the type object when sending point columns to the DB
PostgreSQLのConnectionAdapterの修正です。
Cast
moduleで行っていたPointの変換処理をtype配下のPoint
クラスで処理を行うよう修正しています。
Remove array workaround in PG quoting
activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
の修正です。
arrayに関するquote処理を削除しています。
もう不要なワークアラウンド処理でとの事。
Remove unused array_member
from PG quoting for HStore columns
activerecord/lib/active_record/connection_adapters/postgresql/cast.rb
、activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
の修正です。
使用していないarray_member
変数を削除しています。
Update documentation on STI change handling
activerecord/lib/active_record/base.rb
のdocの修正です。
サブクラスはインスタンス生成時にdirtyマークがついている旨説明追加しています。
class Company < ActiveRecord::Base; end class Firm < Company; end Company.new.changed? # => false Firm.new.changed? # => true Firm.new.changes # => {"type"=>["","Firm"]}
これ知らなかったです。changes
メソッド、こんな動きするんですねえ。