2017/08/15分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Railties updates for frozen string literals.
railtiesの修正です。
frozen_string_literalを指定した場合にエラーにならないよう、Stringを変更する箇所でdup
を呼び出す等修正しています。
Adding frozen_string_literal pragma to Railties.
railtiesの修正です。
各ファイルの先頭にfrozen_string_literal: true
を指定するよう修正しています。
Run Active Storage service tests in CI
.travis.yml
の修正です。
Active Storageのserive testがCIで実行されるよう、AWS, GCP及びAzureアカウントの情報をCIで使えるよう設定を行っています。
Add frozen string pragma to expected routes files.
railties/test/generators/actions_test.rb
の修正です。
テスト内で使う為のroutesにfrozen_string_literal: true
を指定するよう修正しています。
Allow for frozen string pragma in generated files.
railties/test/isolation/abstract_unit.rb
の修正です。
frozen_string_literal: true
を指定する事により、テスト用データを追加する行数がずれてしまった箇所があったのを修正しています。
Merge pull request #29994 from y-yagi/fix_test_runner_help
railtiesの修正です。
test runnerのhelpにminitest、及び、その他pluginのオプションが表示されなくなってしまっていたのを、再度表示されるよう修正しています。
Merge pull request #30206 from yukihirop/improve_activerecord_rdoc
activerecord/RUNNING_UNIT_TESTS.rdoc
の修正です。
テスト対象のadapterを指定 + テストを一つだけ実行する場合の実行方法を追加しています。
Merge pull request #30241 from yhirano55/optimize_routes_indentation
railtiesの修正です。
generatorで生成するroutesファイルのインデントがずれる場合があったのを調整、及び、namespace + 複数アクションをgeneratorに指定した場合、namespaceが別々に定義されてしまっていたのを一つにマージするよう修正しています。
bin/rails g controller foo/bar/baz index show
上記コマンドを実行した場合に、
# config/routes.rb namespace :foo do namespace :bar do get 'baz/index' get 'baz/show' end end
というようにroutesが生成されるよう修正しています。
Merge pull request #30239 from bogdanvlviv/improve-plugin_generator_code
railties/lib/rails/generators/rails/plugin/plugin_generator.rb
の修正です。
plugin generatorに渡すオプションの一覧にapi
オプションを渡すよう修正、及び、不要なforce
オプションは渡さないよう修正しています。
Merge pull request #30235 from bogdanvlviv/omit-additional-removing-cable_yml
railties/lib/rails/generators/rails/app/app_generator.rb
の修正です。
不要なconfig/cable.yml
の削除処理を削除しています。skip_action_cable
オプションを指定した場合、そもそも左記ファイルは作成されない為。
Merge pull request #30233 from kamipo/remove_duplicated_join_id_for
activerecord/lib/active_record/reflection.rb
の修正です。
BelongsToReflection#join_id_for
及びThroughReflection#join_id_for
メソッドを削除しています。親クラスのjoin_id_for
メソッドを使用すれば良い為。
Merge pull request #30244 from yhirano55/refactor_max_age_seconds
railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
、
railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt
の修正です。
Cache-Control
のmax-age
の指定例から、不要なseconds
の呼び出しを削除しています。
- 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}" + 'Cache-Control' => "public, max-age=#{2.days.to_i}"
Durationクラスのto_i
は必ず秒の値を返す為。
Merge pull request #30231 from kamipo/remove_unused_source_type_info
activerecord/lib/active_record/reflection.rb
の修正です。
使用していないRuntimeReflection#source_type_info
メソッドを削除しています。
Active Storageのテストの修正です。
activestorage/test/filename_test.rb
をactivestorage/test/models/filename_test.rb
に移動しています。ActiveStorage::Filename
はmodelの為。
Fix asset pipeline guide [skip ci]
rails guideのThe Asset Pipeline
の修正です。
Rails.application.config.assets.paths
を指定するexampleがconfig/application.rb
に指定するよになっていたのを、現行のコードと同じように、config/initializers/assets.rb
に指定するよう修正しています。
Fix guide about command_line [ci skip]
rails guideのThe Rails Command Line
の修正です。
bin/rails generate
コマンドのexampleに不足していたchannel
を追加、及び、scaffold
のexampleに不足していたsystem testのファイル生成例を追加しています。
Merge pull request #30236 from padi/find-each-example-update
activerecord/lib/active_record/relation/batches.rb
のdocの修正です。
ActiveRecord::Batches.find_each
メソッドのdocのexampleにfinish
オプションを指定した場合のexampleを追加しています。
Merge pull request #30214 from kirs/uniqueness-scope-validator
activerecord/lib/active_record/validations/uniqueness.rb
の修正です。
validates_uniqueness_of
のscope
オプションに不正な値(Symbol又はSymbolのArray以外の値)を指定した場合に、ArgumentError
をraiseするよう修正しています。
Merge pull request #30229 from kamipo/allow_serialize_with_custom_coder
activerecord/lib/active_record/attribute_methods/serialization.rb
の修正です。
json
及びarray
カラムをserialize
する際に、任意のcoderを使用出来るよう修正しています。
hstore
カラムでは任意のcoderを使用出来るよになっており、それに合わせる為対応したようです。
Merge pull request #27609 from kamipo/fix_association_primary_key
activerecord/lib/active_record/associations/collection_association.rb
、
activerecord/lib/active_record/reflection.rb
の修正です。
has_many associationにprimary_key
オプションを指定している場合に、collection_singular_ids
メソッドがエラーになってしまう(primary_key
オプションで指定した値を正しく扱っていない)バグがあったのを修正しています。
Merge pull request #30208 from kamipo/extract_primary_key_to_abstract_reflection
activerecord/lib/active_record/reflection.rb
の修正です。
AssociationReflection
クラス、HasManyReflection
クラスそれぞれで同じ内容のprimary_key
メソッドを定義していたのを、親クラスのAbstractReflection
でメソッドを定義し、子クラスからはメソッドを削除するよう修正しています。
Merge pull request #30219 from yhirano55/fix_app_generator_api_options
railtiesの修正です。
rails new
に--api
オプションを指定した場合のテストのリファクタとして、重複していたテストを削除、テスト対象のファイル名をタイポしていたのを修正等を行っています。
Merge pull request #30073 from yalab/fixture_binary_helper
activerecord/lib/active_record/fixtures.rb
の修正です。
binary
ファイルを読み込む為のbinary
メソッドをfixtureで使用出来るよう修正しています。
実装は下記のような感じ。
def binary(path) %(!!binary "#{Base64.strict_encode64(File.read(path))}") end
Merge pull request #30215 from untidy-hair/clarify-abstract-or-not-in-tests
activerecord/test/cases/associations/join_model_test.rb
、
activerecord/test/cases/inheritance_test.rb
の修正です。
STIを使用しているabstractクラスの子クラスのクラスが正しく動作する事を確認するテストを追加しています。
Merge pull request #30169 from awortham/awortham/awortham/fix-sql-distinct-bug
activerecord/lib/active_record/relation/calculations.rb
の修正です。
has_many :through
associationに対して、distinct
を指定したsum
メソッドが正しく動作しないバグがあったのを修正しています。
Fix format of generator docs [ci skip]
railties/lib/rails/generators/actions.rb
のdocの修正です。
Generators::Actions#lib
メソッドのdoc内のlib
ディレクトリをタイプライター体で表示されるようttタグを追加しています
Formatting CHANGELOGs [ci skip]
activerecord/CHANGELOG.md
、
railties/CHANGELOG.md
の修正です。
各エントリーのフォーマットの修正を行っています。
Fix typo for api_app_generator_test
railties/test/generators/api_app_generator_test.rb
の修正です。
test_api_modified_files
でassets
をasserts
にタイポしていたのを修正しています。