なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2014/06/26)

2014/06/26分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

activemodel/CHANGELOG.md

activerecord/CHANGELOG.md


Move behavior of read_attribute to AttributeSet

ActiveRecordの修正です。

read_attributeメソッドの処理をAttributeSetに移譲したのと、AttributeSet::Builderクラスを別ファイルに切り出しています。


synchronize Active Record deprecations / removals with 4.2 release notes

guides/source/4_2_release_notes.mdの修正です。

ActiveRecordのremove / deprecate になるメソッドについて追記しています。

徐々に4.2の準備が。


sync deprecations and removals with 4.2 release notes. [ci skip]

同じくguides/source/4_2_release_notes.mdの修正です。

こちらは、ActionViewとActiveModelのメソッドについです。


docs, fix BacktraceCleaner code example. Closes #15911. [ci skip]

activesupport/lib/active_support/backtrace_cleaner.rbのdocの修正です。

exampleの処理が誤っていたのを修正しています。


Merge pull request #15846 from sgrif/sg-attributes-before-type-cast

activerecord/lib/active_record/attribute_methods/before_type_cast.rbactiverecord/lib/active_record/attribute_set.rbの修正です。

attributes_before_type_castメソッドの処理をAttributeSetクラスに移譲しています。


Merge pull request #15847 from sgrif/sg-encapsulate-result-types

ActiveRecordの修正です。

type objectsに関する処理をActiveRecord::Resultクラスに集約しています。リファクタリングですね。


Encapsulate the creation of Attribute objects

ActiveRecordの修正です。

Attributeオブジェクトの生成処理を隠蔽するよう修正しています。

プロパティ追加の際の処理を楽にするため、のようです。


Require shellwords since it is dependecy of this file

railties/lib/rails/generators/testing/assertions.rbの修正です

require 'shellwords'を追加しています。


Merge pull request #15834 from rmehner/allow_proc_and_symbol_for_only_integer

activemodel/lib/active_model/validations/numericality.rbの修正です。

NumericalityValidatoronly_integerの値にSymbolProcクラスを指定出来るよう修正しています。

テストコードから抜粋。

Topic.send(:define_method, :allow_only_integers?, lambda { false })
Topic.validates_numericality_of :approved, only_integer: Proc.new {|topic| topic.allow_only_integers? }

Procクラス指定出来るのは割と便利そうな。


Merge pull request #15845 from robin850/jruby-isolation

activesupport/lib/active_support/testing/isolation.rbの修正です。

JRubyでisolationのテストが動くために対応しているとの事です。JRuby…!


Attribute should know about its name

ActiveRecordのattribute関連のクラスを修正してます。

Attributeクラスの各メソッドの引数にnameを追加しています。


Deprecate automatic counter caches on has_many :through

ActiveRecordのassociations関連のクラスの修正です。

has_many :throughアソシエーションを使用している場合にcounter cacheを使用するのはdeprecateになりました。 5系で削除予定

そもそも、has_many :throughの場合のcounter cacheはドキュメントに無い振る舞いだったとの事です。

has_manyアソシエーションについては変わらず使用できます。


Consolidate testing of update_all type casting

ActiveRecordのテストの修正です。

update_allのテストをactiverecord/test/cases/relation_test.rbにまとめています。