なるようになるブログ

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

rails commit log流し読み(2015/01/30)

2015/01/30分のコミットです。

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

activerecord/CHANGELOG.md

railties/CHANGELOG.md


Fixed AR::Relation#group method when argument is a SQL reserved keyword

activerecord/lib/active_record/relation/query_methods.rbの修正です。

ActiveRecord::Relation#groupメソッドの引数にSQLの予約後(:key、:where、等)を指定した場合に値が正しく取得出来ないバグがあったのを修正しています。


Change option description and update test names

railties/lib/rails/generators/app_base.rbの修正です。

app generate時に指定するskip_testオプションのdescriptionがSkip ActiveSupport::TestCase filesとなっていたのをSkip test filesに修正しています。 クラス名を明確に記載する必要は無いので、という事で修正しています。


Post.all.or(anything) == Post.all

activerecord/lib/active_record/relation/where_clause.rbの修正です。

orメソッド内の判定処理を修正し、Post.all.or(anything) == Post.allがtrueになるよう修正しています。

Post.all == Post.or(Post.where('id = 1')).to_a  #=> true

Merge pull request #18705 from mrgilman/skip-test

app generatorの修正です。

テストスキップ用オプションをskip_test_unitからskip_testに修正しています。rails はデフォルトではTest::Unitのファイルを作成しないので、修正したとの事です。


Remove duplicated tests

actionpack/test/controller/integration_test.rbの修正です。

重複しているテストコードを削除しています。


Doc: run bundle update after cloning Rails.

rails guideのContributing to Ruby on Railsの修正です。

railsにcontributeする際、 git cloneでコードを取得後、bundle updatを実施するよう説明を追加しています。


Add a margin to body and padding to th, td.

railties/lib/rails/generators/rails/scaffold/templates/scaffold.cssの修正です。

scaffoldで生成されるcssにth、tdにパディングを、bodyにマージンを設定するスタイルを追加しています。

before before

after after


Improvements about schema dumping [ci skip]

rails guideのActive Record Migrationsの修正です。

foreign keys、Reverting Previous Migrationsそれぞれの項にSchema Dumping and Youへのリンクの追加、 Types of Schema Dumpsの項のグラマーの修正を行っています。


Fix grammar in Qualified Constants section

rails guideのAutoloading and Reloading Constantsの修正です。

Resolution Algorithm for Qualified Constantsの項のグラマーの修正を行っています。


tests, use capture instead of custom redirect_stderr helper.

railties/test/application/test_runner_test.rbの修正です。

stderrの値を取得する際、ファイル内で独自に定義しているredirect_stderrメソッドではなく共通メソッドとして定義しているcaptureメソッドを使用するよう修正しています。


scaffold controller_test template should use kwargs. refs #18323.

railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rbの修正です。

generaterが生成するテストコードで、request methodsへの引数の渡し方を、先日コミットされた新しいフォーマットで渡すよう修正しています

-      post :create, <%= "#{singular_table_name}: { #{attributes_hash} }" %>
+      post :create, params: { <%= "#{singular_table_name}: { #{attributes_hash} }" %> }

build fix.

railties/test/generators/scaffold_controller_generator_test.rbの修正です。

直ぐ上の対応のコミットの影響でテストが壊れていた箇所があったのを修正しています。


build fix II, adjust broken tests as a consequence of 670ac73126.

railties/test/generators/scaffold_generator_test.rbの修正です。

先のコミット同様、scaffold controller_test template should use kwargs. refs #18323.の対応でエラーになってしまっていたテストを修正しています。


fix typo in _filter deprecation message. [ci skip]

actionpack/lib/abstract_controller/callbacks.rbの修正です。

_filterメソッドのdeprecateメッセージにタイポがあったのを修正しています。


Always perform validations on nested attribute associations

activerecord/lib/active_record/autosave_association.rbactiverecord/lib/active_record/nested_attributes.rbの修正です。

singular associationsの場合にvalidationが実行されないバグがあったを、必ずvalidationが実行されるよう修正しています。

少し前にコミットされたDon't redefine autosave association callbacks in nested attrsの影響とのこと。