2014/06/17分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Merge pull request #13963 from lucas-clemente/pending_migrations
activerecord/lib/active_record/migration.rb
の修正です。
CheckPending
クラスの引数にconnectionを追加し、adapterがマイグレーションをサポートしていない場合、migration checkをスキップするよう対応しています。
Merge pull request #15684 from aditya-kapoor/add-tests-for-assert-valid-keys
activesupport/test/core_ext/hash_ext_test.rb
の修正です。
Hash#asset_valid_keys
メソッドのテストケースを追加しています。
Hash#assert_valid_keys
メソッド、知らなかったのですが、Hashに引数に指定したkeyの値が無い場合にエラーになるメソッドなんですね。
{ :failore => "stuff", :funny => "business" }.assert_valid_keys([ :failure ]) # ArgumentError: Unknown key: :failore. Valid keys are: :failure
[ci skip] correct doc for serialization in accordance with API Doc Guide
activemodel/lib/active_model/serialization.rb
のdocの修正です。
serialization処理に関する説明を修正しています。
Refactor in-place dirty checking to use the attribute object
activerecord/lib/active_record/attribute.rb
、activerecord/lib/active_record/attribute_methods/dirty.rb
の修正です。
dirtyチェック処理のリファクタリング。共通処理をメソッドに切り出しています。
Add important plugins as one of the tasks of the release
RELEASING_RAILS.rdoc
の修正です。
release時の作業時に重要なプラグインが動作するか確認する、というのが付け加えられています。追加されたのは以下の2つ。
- https://github.com/rails/protected_attributes
- https://github.com/rails/activerecord-deprecated_finders
Rails 5まではサポートする、との事です。
:scissors: and :nail_care: from d60c405 [ci skip]
activemodel/lib/active_model/serialization.rb
のdocの修正です。
先ほどコミットされた同ファイルの修正に対して、改行とttタグの追加を行っています。
[ci skip] add API doc for AR Group.
activerecord/lib/active_record/relation/calculations.rb
のdocの修正です。
groupメソッドの実行例を追加しています。
Article.group(:status, :category).count # => {["draft", "business"]=>10, ["draft", "technology"]=>4, # ["published", "business"]=>0, ["published", "technology"]=>2}
[ci skip] /javascript/ ~> JavaScript
actionpack/lib/action_controller/metal/mime_responds.rb
のdocの修正です。
コメントの通り、"javascript"を"JavaScript"に修正しています。
Refactor application of type decorators into an object
activerecord/lib/active_record/attribute_decorators.rb
の修正です。
TypeDecorator
クラスを新規に作成して、decoration関連の処理をそちらにまとめています。
Promote time zone aware attributes to a first class type decorator
ActiveRecordのdecorators関連の処理のリファクタリングです。
decorate_matching_attribute_types
メソッドを追加して、decorato処理に条件設定出来るようにした、だと思うのでうが、コミットログのコメントはちょっ違うんだよなあ…。むう。
Formatting fix in AS changelog [ci skip]
activesupport/CHANGELOG.md
の修正です。
"before"を"Before"に、"after"を"After"にそれぞれ修正しています。
[ci skip] doc corrected : ActiveRecord::Base.connections to ActiveRecord::Base.configurations
rails guideのConfiguring Rails Applications
の修正です。
ActiveRecord::Base.connections
をActiveRecord::Base.configurations
に修正です。多分タイポですね。
fix typo in test method names. [ci skip]
activerecord/test/cases/tasks/database_tasks_test.rb
の修正です。
メソッド名をxxx_creates_xxx
から、xxx_drops_xxx
に修正しています。これもタイポですね。
add bin/rake db:purge
task to empty the current database.
activerecord/lib/active_record/railties/databases.rake
と、activerecord/lib/active_record/tasks/database_tasks.rb
の修正です
bin/rake db:purge
というtaskを追加しています。DBを空にする為のタスクです。
ConnectionAdapterによって細かな動作は違うのですが、基本的にはDBの再作成を行っているようです。開発時に割と便利。
Move test teardown into ensure
block.
activesupport/test/core_ext/kernel/concern_test.rb
の修正です。
Object.send :remove_const, :ToplevelConcern
をensure
ブロックに移動しています。必ず処理が行われるようにですね。