2019/01/18分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Seed database with inline ActiveJob job adapter.
- Remove deprecated
config.secret_token
- Remove deprecated
capify!
- Remove deprecated
environment
argument from the rails commands - Remove deprecated support to old
config.ru
that use the application class as argument ofrun
. - Remove deprecated
after_bundle
helper inside plugins templates
- Ensure external redirects are explicitly allowed
- Remove deprecated methods in
ActionDispatch::TestResponse
. - Remove deprecated
fragment_cache_key
helper in favor ofcombined_fragment_cache_key
- Remove deprecated
expand_hash_conditions_for_aggregates
- Remove deprecated
ActiveRecord::Migrator.migrations_path=
- Remove ability to specify a timestamp name for
#cache_key
- Change
SQLite3Adapter
to always represent boolean values as integers. - Deprecate
config.activerecord.sqlite3.represent_boolean_as_integer
. - Remove delegation of missing methods in a relation to private methods of the class
- Remove delegation of missing methods in a relation to arel
- Do not allow passing the column name to
count
when a block is passed - Do not allow passing the column name to
sum
when a block is passed - Remove deprecated
ActiveRecord::ConnectionAdapters::SQLite3Adapter#valid_alter_table_type?
- Remove deprecated
#insert_fixtures
from the database adapters - Remove deprecated
#supports_statement_cache?
from the database adapters - Remove deprecated
#set_state
from the transaction object
Merge pull request #34213 from matildasmeds/guides_session_guidelines_2
rails guideのSecuring Rails Applications
の修正です。
古いバージョンに関する説明を削除、諸々言い回しを修正、Action Controller guide・Custom Credentialsの項へのリンクの追加等々を行っています。
Make trix a peer dependency of actiontext since it’s not used directly
actiontext/app/javascript/actiontext/index.js
、
actiontext/package.json
の修正です。
trixのdependencyをpeer dependencyに移動しています。Action Textは直接はtrixを使用していない為。
Tidy up action_text:install task
actiontext/lib/templates/installer.rb
の修正です。
action_text:install
task実行時に必要なjsのpackageのインストールも行うよう修正しています。
Merge pull request #34953 from gmcgibbon/seed_with_inline_jobs
railties/lib/rails/engine.rb
の修正です。
seedを読み込む際にActive Jobのadapterを強制的にinlineにするよう修正しています。
seedでActive Storageのattachmentを登録する、かつ、adapterがasnycの場合処理が完了しない(デットロックになってしまいハングしてしまう)為、強制的にinline adapterを使用するよう修正しています。
Ensure Action Mailbox processes an email only once when received multiple times
Action Mailboxの修正です。
同じメールを複数回受信した場合に、一度だけ処理を行うよう修正しています。同一かどうかの判定用に、checksum(Digest::SHA1.hexdigest
で生成)の値も保持するよう修正しています(message idが無かった場合にchecksumで同一判定出来るようにする為)。
Ensure external redirects are explicitly allowed
Action Packの修正です。
redirect_to
メソッドで、明示的に許可されている(allow_other_host
オプションにtrueが指定されている)場合のみ、外部サイトへのredirectを許可するよう修正しています。allow_other_host
がfalse(デフォルト)の状態で外部サイトにredirectしようとすると、ArgumentError
になるようなっています。
Ensure that AR::Relation#exists? allows only permitted params
activerecord/test/cases/finder_test.rb
の修正です。
exists?
メソッドの引数にActionController::Parameters
のインスタンスを指定出来る事を確認するテストを、permitted paramのみ使用される事を確認するよう修正しています。
actionmailbox/db/migrate/20180917164000_create_action_mailbox_tables.rb
の修正です。
action_mailbox_inbound_emails
のmessage_id + message_checksumのindexに明示的にnameを指定するよう修正しています。nameの指定が無いとindex長でエラーになる為。
Use create_and_extract_message_id! to create an inbound email.
actionmailbox/app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb
の修正です。
inbound emailを作成する際に、ActionMailbox::InboundEmail.create_and_extract_message_id!
メソッドを使用するよう修正しています。checksumとmessage idがセットされるようにする為。
Update the promisse that ActionController::TestCase will be extracted
actionpack/lib/action_controller/test_case.rb
のdocの修正です。
ActionController::TestCase
について説明している箇所で、Rails 5.1でgemに切り出す旨記載されいたのを、"the future"と記載するよう修正しています。gemに切り出すつもりはあるのですが、それをいつ行うかはまだ未定の為。
Remove deprecated methods in ActionDispatch::TestResponse
actionpack/lib/action_dispatch/testing/test_response.rb
の修正です。
deprecatedになっていたActionDispatch::TestResponse
のメソッド(success?
、missing?
、error?
等)を削除しています。
Remove deprecated fragment_cache_key
helper in favor of combined_fragment_cache_key
actionpack/lib/abstract_controller/caching/fragments.rb
の修正です。
deprecatedになっていたfragment_cache_key
メソッドを削除しています。
Remove deprecated image_alt helper
actionview/lib/action_view/helpers/asset_tag_helper.rb
の修正です。
deprecatedになっていたimage_alt
メソッドを削除しています。
Remove deprecated expand_hash_conditions_for_aggregates
activerecord/lib/active_record/sanitization.rb
の修正です。
deprecatedになっていたexpand_hash_conditions_for_aggregates
メソッドを削除しています。
Remove deprecated ActiveRecord::Migrator.migrations_path=
activerecord/lib/active_record/migration.rb
の修正です。
deprecatedになっていたActiveRecord::Migrator.migrations_path=
メソッドを削除しています。
Remove ability to specify a timestamp name for #cache_key
activerecord/lib/active_record/integration.rb
の修正です。
deprecatedになっていたcache_key
メソッドのtimestamp引数を削除しています。
Change SQLite3Adapter
to always represent boolean values as integers
Active Recordの修正です。
SQLite 3 adapterでbooleanの値を保持するのにintegerを使用するよう修正しています。合わせて、挙動を指定する為のconfig.activerecord.sqlite3.represent_boolean_as_integer
はdeprecateになりました。
Remove delegation of missing methods in a relation to private methods of the class
activerecord/lib/active_record/relation/delegation.rb
の修正です。
deprecatedになっていたrelationからclassのprivate methodへのdelegationを削除しています。
Remove delegation of missing methods in a relation to arel
activerecord/lib/active_record/relation/delegation.rb
の修正です。
deprecatedになっていたrelationからarelへのdelegationを削除しています。
Do not allow passing the column name to count
when a block is passed
activerecord/lib/active_record/relation/calculations.rb
の修正です。
deprecatedになっていたcount
メソッドにblock + column name引数両方を指定した場合の処理を削除しています。
Do not allow passing the column name to sum
when a block is passed
activerecord/lib/active_record/relation/calculations.rb
の修正です。
deprecatedになっていたsum
メソッドにblock + column name引数両方を指定した場合の処理を削除しています。
Remove deprecated ActiveRecord::ConnectionAdapters::SQLite3Adapter#valid_alter_table_type?
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
の修正です。
deprecatedになっていたActiveRecord::ConnectionAdapters::SQLite3Adapter#valid_alter_table_type?
メソッドを削除しています。
Remove deprecated #insert_fixtures
from the database adapters
activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
、
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
の修正です。
deprecatedになっていたinsert_fixtures
メソッドを削除しています。
Remove deprecated #supports_statement_cache?
from the database adapters
activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
の修正です。
deprecatedになっていたsupports_statement_cache?
メソッドを削除しています。
Remove deprecated #set_state
from the transaction object
activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
の修正です。
deprecateになっていたTransactionState#set_state
メソッドを削除しています。
Remove deprecated #acronym_regex
method from Inflections
activesupport/lib/active_support/inflector/inflections.rb
の修正です。
deprecatedになっていたInflections#acronym_regex
メソッドを削除しています。
Remove deprecated Module#reachable?
method
activesupport/lib/active_support/core_ext/module.rb
、
activesupport/lib/active_support/core_ext/module/reachable.rb
の修正です。
deprecateになっていたModule#reachable?
メソッドを削除しています。
Remove deprecated config.secret_token
railtiesの修正です。
deprecateになっていたconfig.secret_token
を削除しています。
Remove secret_token rack env and cookie upgrade code
Action Packの修正です。
cookieの secret_token
に関する処理を削除しています。config.secret_token
が削除された事により動作しなくなった為。
railties/lib/rails/generators/actions.rb
の修正です。
deprecateになっていたcapify!
メソッドを削除しています。
Remove deprecated environment
argument from the rails commands
railtiesの修正です。
deprecatedになっていたrails console、rails dbconsoleコマンドのenvironment
引数を削除しています。
Remove deprecated support to old config.ru
that use the application class as argument of run
railties/lib/rails/commands/server/server_command.rb
の修正です。
deprecatedになっていいたconfig.ru
内のrun
メソッドににRails::Application
のサブクラスを指定した場合の処理を削除しています。
Remove deprecated server
argument from the rails server command
railties/lib/rails/commands/server/server_command.rb
の修正です。
rails server
コマンドにRack server nameをオプションなしで指定した場合の処理を削除しています。
deprecatedだった為、となっていますが、この機能がdeprecatedになったのはRails 6から削除対象では無いため、後ほどrevertされています。
Remove deprecated after_bundle
helper inside plugins templates
railtiesの修正です。
deprecatedになっていたplugins templatesの中でのafter_bundle
メソッドの実行を削除しています。
Gemfile
、railties/lib/rails/generators/app_base.rb
の修正です。
rails自体でリリース済みのwebpackerを使用するよう修正、及び、新規に作成するRailsアプリではwebpacker 4.0.0.rc.3以上を使用するようバージョン指定を追加しています。
Action Text: bundle package.json in built gem.
actiontext/actiontext.gemspec
の修正です。
Action Textのgem packageにpackage.json
も含むよう修正しています。
action_text:install
taskでpackage.json
を使用する(依存しているパッケージのインストールに使用している)為。
Merge pull request #34963 from dylanahsmith/better-composed-of-single-field-query
activerecord/lib/active_record/relation/predicate_builder.rb
の修正です。
mappingがある場合のaggregate処理のqueryがシンプルなqueryになるよう修正しています。
例。
class Customer < ActiveRecord::Base composed_of :balance, class_name: "Money", mapping: %w(balance amount) end
# before Customer.where(balance: (1..50).map { |amount| Money.new(amount) }).to_sql #=> SELECT "customers".* FROM "customers" WHERE ((((((((((((((((((((((((((((((((((((((((((((((((("customers"."balance" = 1 OR "customers"."balance" = 2) OR "customers"."balance" = 3) OR "customers"."balance" = 4) OR "customers"."balance" = 5) OR "customers"."balance" = 6) OR "customers"."balance" = 7) OR "customers"."balance" = 8) OR "customers"."balance" = 9) OR "customers"."balance" = 10) OR "customers"."balance" = 11) OR "customers"."balance" = 12) OR "customers"."balance" = 13) OR "customers"."balance" = 14) OR "customers"."balance" = 15) OR "customers"."balance" = 16) OR "customers"."balance" = 17) OR "customers"."balance" = 18) OR "customers"."balance" = 19) OR "customers"."balance" = 20) OR "customers"."balance" = 21) OR "customers"."balance" = 22) OR "customers"."balance" = 23) OR "customers"."balance" = 24) OR "customers"."balance" = 25) OR "customers"."balance" = 26) OR "customers"."balance" = 27) OR "customers"."balance" = 28) OR "customers"."balance" = 29) OR "customers"."balance" = 30) OR "customers"."balance" = 31) OR "customers"."balance" = 32) OR "customers"."balance" = 33) OR "customers"."balance" = 34) OR "customers"."balance" = 35) OR "customers"."balance" = 36) OR "customers"."balance" = 37) OR "customers"."balance" = 38) OR "customers"."balance" = 39) OR "customers"."balance" = 40) OR "customers"."balance" = 41) OR "customers"."balance" = 42) OR "customers"."balance" = 43) OR "customers"."balance" = 44) OR "customers"."balance" = 45) OR "customers"."balance" = 46) OR "customers"."balance" = 47) OR "customers"."balance" = 48) OR "customers"."balance" = 49) OR "customers"."balance" = 50) # after Customer.where(balance: (1..50).map { |amount| Money.new(amount) }).to_sql #=> SELECT "customers".* FROM "customers" WHERE "customers"."balance" IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50)
Merge pull request #34956 from kamipo/actionmailbox_datetime_precision
actionmailbox/db/migrate/20180917164000_create_action_mailbox_tables.rb
の修正です。
action_mailbox_inbound_emails
tableでprecision
をサポートしている場合のにtimestampsにprecision
オプションを指定するよう修正しています。MySQL 5.5ではdatetimeにprecision
は指定出来ない為。
Revert "Remove deprecated server
argument from the rails server command"
rails server
コマンドにRack server nameをオプションなしで指定した場合の処理を削除した、Remove deprecated server
argument from the rails server commandをrevertしています。Rails 6で削除対象では無いため。
Use unboundable?
rather than boundable?
Active Recordの修正です。
boundable?
メソッドの代わりにunboundable?
メソッドを定義、及び使用するよう修正しています。
infinite?
メソッドと同じような使い方を出来るようにする為、のようです。おそらく。
Merge pull request #34969 from eileencodes/fix-error-message-for-multi-db-apps
activerecord/lib/active_record/connection_adapters/connection_specification.rb
の修正です。
指定されたadapterがDBのconfigに存在しなかった場合のエラーメッセージが、adapter名のみ表示していたのを、env名と合わせて表示するよう修正しています。
例。
'doesnexist' database is not configured. Available: development, development, test, test, production, production (ActiveRecord::AdapterNotSpecified)
The `doesntexist` database is not configured for the `production` environment. (ActiveRecord::AdapterNotSpecified) Available databases configurations are: development: primary, primary_readonly test: primary, primary_readonly production: primary, primary_readonly
Merge pull request #34972 from krzysiek1507/fix/date-advance-performance
activesupport/lib/active_support/core_ext/date/calculations.rb
の修正です。
Date#advance
メソッドでoptionsの複製処理を無くすようリファクタリングを行っています。
Merge pull request #34959 from alkesh26/action-cable-typo-fixes
Action Cableの修正です。
諸々タイポしている箇所があったのを修正しています。
Merge pull request #30000 from kamipo/all_of_queries_should_return_correct_result
Active Recordの修正です。
RangeError
の扱いに誤りがあり、巨大な数字を含むqueryを実行した場合に正しい結果が取得出来ない、というバグがあったのを修正しています。