2015/12/16分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Remove warning of shadowing variable
actionpack/lib/action_controller/caching/fragments.rb
の修正です。
ActionController::Caching::Fragments#fragment_cache_key
メソッドでShadowing outer local variable
warningが出ていたので、変数名を変更して対応しています。
Merge pull request #14212 from tylerhunt/fix-token-regex
actionpack/lib/action_controller/metal/http_authentication.rb
の修正です。
authentication tokenにタブ(\t)が入っていても良いように、空白のチェックを"\s"で行うよう修正しています。
- TOKEN_REGEX = /^(Token|Bearer) / + TOKEN_REGEX = /^(Token|Bearer)\s+/
Merge pull request #22562 from sblackstone/master
activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
の修正です。
MySQL2 adapterの場合に、database.yml
にflags
の値を指定出来るよう修正しています。
参考:mysql2/README.md at master · brianmario/mysql2
Do not default to any Serializer
railties/lib/rails/generators/app_base.rb
、
railties/lib/rails/generators/rails/app/templates/Gemfile
の修正です。
rails apiの場合、デフォルトのGemfileでactive_model_serializers
を使用するようになっていたのを、通常のrails app同様jbuilder
を使用するよう修正しています。
コミットログにWe will wait until 5.1 to make a decision
と書かれているので、見送りになったんですねえ。
Update test generators to use ActionDispatch::IntegrationTest
railtiesの修正です。
先日、docだけ先に修正(Remove ActionController::TestCase from documentation)された対応の関連で、各generatorsが生成するテスト用のファイルでActionDispatch::IntegrationTest
を使用するよう修正、及び既存のテストでActionDispatch::IntegrationTest
を使用するよう修正しています。
Run railties generated app tests in test env
railties/test/application/rake_test.rb
の修正です。
generatorsで生成されたファイルを実行するテストで、テストをdevelopment
環境で実行してしまっていたのを、env
環境で実行するようRAILS_ENV
の指定を追加しています。
deletes code commented out in 72160d9f
actionpack/test/controller/helper_test.rb
のdocの修正です。
helperのテストから、不要なコメントを削除しています。
deletes commented code introduced in 4673c47d
actionview/test/template/date_helper_test.rb
の修正です。
select_month
メソッドのテストから、不要なコメントを削除しています。
deletes commented code introduced in db045db (initial commit)
actionview/test/template/date_helper_test.rb
、
activerecord/test/cases/fixtures_test.rb
の修正です。
#select_year
、#select_minute
、#select_second
、の各メソッドのテスト、及びfixtureのテストから不要なコメントを削除しています。
deletes commented code introduced in f238d495
activesupport/bin/generate_tables
の修正です。
ActiveSupport::Multibyte::Unicode::DatabaseGenerator#parse_codepoints
から不要なコメントを削除しています。
delete code commented out (and replaced) in e93d0a5
activesupport/lib/active_support/core_ext/time/calculations.rb
の修正です。
Time#beginning_of_day
メソッドから不要なコメントを削除しています。
Introduce ApplicationRecord, an Active Record layer supertype
Active Recordの修正です。
generatorが生成するmodelクラスが全てApplicationRecord
クラスの子クラスになるよう修正しています。
例。
# application_record.rb class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end # user.rb class User < ApplicationRecord end
今まではmodel classで直接ActiveRecord::Base
を継承していたのを、controllerやjob同様、application用の親クラスを挟むようになりました。
なお、app/models/application_record.rb
が存在する場合のみmodelの親クラスがApplicationRecord
となるようになり、ファイルが存在しない場合は今まで通りActiveRecord::Base
が親クラスになります。
Deprecate passing string to define callback.
Active Supportの修正です。
callbackの定義にString
を使用するのがdeprecateになりました。
class Topic < ActiveRecord::Base before_destroy 'self.class.delete_all "parent_id = #{id}"' end
こんなの出来たんですねえ。
Fix a couple of grammatical errors in security.md
rails guideのRuby on Rails Security Guide
の修正です。
Intranet and Admin Security
の項のグラマーの修正を行っています。