2016/03/05分のコミットです。
CHANGELOGへの追加はありませんでした。
Make sure ActionCable.Subscriptions#create always returns the newly created subscription object
actioncable/app/assets/javascripts/action_cable/subscriptions.coffee
の修正です。
ActionCable.Subscriptions#create
メソッドが、作成したsubscriptionのobjectを必ず返すよう修正しています。
Return subscription object(s) when updating the collection
actioncable/app/assets/javascripts/action_cable/subscriptions.coffee
の修正です。
ActionCable.Subscriptions
クラスでsubscriptionに対する処理(add / remove等)を行った際に、処理を行った後のsubscriptionの値を返すよう修正しています。
activerecord/lib/active_record/reflection.rb
の修正です。
clear_association_scope_cache
メソッドから、使用していない変数を削除しています。
Fix author callback in engines guide [ci skip]
rails guideのGetting Started with Engines
の修正です。
Using a Model Provided by the Application
の項で、データ保存時にassociationの設定をするexampleで、associationの設定をbefore_save
コールバックで行っていたのを、before_validation
コールバックで行うよう修正しています。
Require belongs_to
by default. by simi · Pull Request #18937 · rails/railsでbelongs_to
associationがデフォルトでrequire: true
となった為、before_save
でassociationを設定するのだと遅い(validation処理でassociationが設定されてない事によりvalidatinoエラーになってしまう)為、before_validation
で行うようにしたとの事です。
don't build the reflection chain to calculate nested?
activerecord/lib/active_record/reflection.rb
の修正です。
#nested?
メソッドでassociationがnestしているかどうかチェックする際に、reflection chainの生成処理を行わないよう修正しています。
reflection treeを横断して処理を行ってしまうのを避ける為、との事です。
We're not using $2 from this Regexp
actionview/lib/action_view/renderer/partial_renderer.rb
の修正です。
PartialRenderer#retrieve_variable
メソッドでpartial templateの名前のチェックをする正規表現で、使用しないグループはキャプチャしないようになっていたのですが、Fix partial rendering with dot in filename by bquorning · Pull Request #24052 · rails/railsの際に誤ってキャプチャするようにしてしまったので、再度キャプチャしないよう修正しています。
Match Puma 3 startup messages [ci skip]
各rails guideの修正です。
rails server
の起動時のメッセージを表示している箇所を、最新の内容(Puma 3の出力内容)に更新しています。
start hiding the scope_chain
data structure
activerecord/lib/active_record/associations/association.rb
、
activerecord/lib/active_record/reflection.rb
の修正です。
scopeがあるかどうかのチェックをscope_chain
を直接参照しチェックを行っていたのを、チェック用に#has_scope?
メソッドを作成し、そちらを使用するよう修正しています。
remove outdated comment [ci skip]
activerecord/test/cases/validations/i18n_validation_test.rb
のdocの修正です。
各テストのコメントにmocha
を使っている旨記載されていたのですが、実際は使用していない(minitest/mockを使用している)為、コメントを削除しています。
railties/test/application/rake_test.rb
の出力です。
[ci skip] correcting test case specifying rails routes
instead of rake routes
by mohitnatoo · Pull Request #24050 · rails/rails でテスト名の変更を行った際、インデントがおかしくなってしまった為、修正しています。
remove config that are no longer needed in sprockets-rails 3
railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
、
railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt
の修正です。
config.assets.raise_runtime_errors
及びconfig.assets.digest
の設定をデフォルトのconfigファイルから削除しています。sprockets-rails 3でデフォルトで有効になった為。
Remove http_cache_forever's version parameter
actionpack/lib/action_controller/metal/conditional_get.rb
の修正です。
ActionController::ConditionalGet#http_cache_forever
メソッドの引数からversion
を削除しています。
一度#http_cache_forever
メソッドでheaderを設定(Cache-Control: max-age=3155760000
)した場合、当然browser / proxyはサーバにリクエストの取得を行わなくなり、再度取得させる為には、headerを設定し直す(Cache-Control: max-age=0
)必要があります。
で、それをするにはquery parameter等を使用してresource URLを変更する必要があります。で、version
パラメータはその役割の為に、と追加されていたのですが、実際はそうは動かない(resource URLは変わらない)為、紛らわしだろう、という事で削除されたようです。
A small documentation fix about autosave associations [ci skip]
activerecord/lib/active_record/autosave_association.rb
のdocの修正です。
AutosaveAssociation
moduleのdoc内のChildren records
をChild records
に修正しています。
railties/lib/rails/generators/rails/app/templates/bin/rails
の修正です。
APP_PATH
(config/application
のpath)を定義するのに、__FILE__
を使用していたのを__dir__
を使用するよう修正しています。
-APP_PATH = File.expand_path('../../config/application', __FILE__) +APP_PATH = File.expand_path('../config/application', __dir__)
fix typo in attribute example [ci skip]
activerecord/lib/active_record/attributes.rb
のdocの修正です。
#attribute
メソッドのexample内でkind_of?
をkind_of
にタイポしていたのを修正しています。