2016/12/30分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Allow passing extra flags to
db:structure:load
anddb:structure:dump
- Remove deprecated
activerecord.errors.messages.restrict_dependent_destroy.one
andactiverecord.errors.messages.restrict_dependent_destroy.many
i18n scopes. - Remove deprecated force reload argument in singular and collection association readers.
- Set
:time
as a timezone aware type and remove deprecation when the values is not explictly set. - Remove deprecated support to passing a column to
#quote
. - Remove deprecated
name
argument from#tables
. #tables
and#table_exists?
and returns only tables and not views.- Remove deprecated
original_exception
argument inActiveRecord::StatementInvalid#initialize
andActiveRecord::StatementInvalid#original_exception
. - Raises when
ActiveRecord::Migration
is inherited directly. - Raise when a through association has an ambiguous reflection name
- Raises
ActiveRecord::IrreversibleOrderError
when usinglast
with an irreversible order. - Remove deprecated support to passing a class as a value in a query
- Remove deprecated support to query using commas on LIMIT
- Remove deprecated support to passing arguments to
#select
when a block is provided. - Remove deprecated conditions parameter from
#destroy_all
and#delete_all
. - Remove deprecated
#load_schema_for
. - Remove deprecated
#raise_in_transactional_callbacks
configuration. - Remove deprecated
#use_transactional_fixtures
configuration. - Remove deprecated
#insert_sql
,#update_sql
, and#delete_sql
- Remove deprecated
#uniq
,#uniq!
, and#uniq_value
Use next
instead of break
; avoid terminating whole loop
actionpack/lib/action_dispatch/journey/formatter.rb
の修正です。
ActionDispatch::Journey::Formatter#generate
メソッドでroutesを生成する際に、parameterとdefault値とチェックの行う際に、値が一致しなかった場合にbreak
でループ処理全体を終了していたのを、next
で処理を継続するよう修正しています。
- break if parameterized_parts[key].to_s != defaults[key].to_s + next if parameterized_parts[key].to_s != defaults[key].to_s
複数のdefaultが設定されていた場合に、途中でループを終了してしまうと他のデフォルト値に対するチェック処理が正しく行えない為、ループ処理全体は回すよう修正したようです。
Merge pull request #26977 from y-yagi/fix_26964
railties/lib/rails/commands/server/server_command.rb
の修正です。
rails server
コマンドにオプションを指定するとオプションパースによるエラーでserverが起動しないバグがあったのを修正しています。
Merge pull request #27346 from utilum/core_ext_guide_duplicable
rails guideのActive Support Core Extensions
の修正です。
duplicable?
メソッドについて説明している箇所に、Ruby 2.4では多くのオブジェクトでdup
及びclone
が可能性である旨説明を追加、及びexampleコードを追加しています。
[ci skip] Rejigger the dublicable? wording a bit.
rails guideのActive Support Core Extensions
の修正です。
duplicable?
メソッドについて説明している箇所のグラマー、言い回しの修正等を行っています。
Merge pull request #27437 from kirs/structure-load-dump-flags
Active Recordの修正です。
db:structure:load
タスク、及び、db:structure:dump
タスクで実行するコマンド(mysqldump
、pg_dump
等)に任意のオプションを指定出来るよう対応しています。
オプションはActiveRecord::Tasks::DatabaseTasks.structure_load_flags
、及び、ActiveRecord::Tasks::DatabaseTasks.structure_dump_flags
経由で指定する事が出来るようになっています。
Remove try! usage in sqlite_database_tasks.
activerecord/lib/active_record/tasks/sqlite_database_tasks.rb
の修正です。
structure_dump
、structure_load
メソッドでflagのパース処理でtry!
メソッドを使用していたのを、使用しないよう修正しています。
Railsコード内部ではtry!
は使用しないようにしたい為、との事です。ASに依存するメソッドをあまり使いたく無い為だと思います。
[ci skip] Add changelog for 261e94b.
activerecord/CHANGELOG.md
の修正です。
先のdb:structure:load
タスク及びdb:structure:dump
タスクで実行するコマンドに任意のオプションを指定出来るようにした対応について、CHANGELOGにエントリーを追記しています。
fix with_routing when testing api only controllers
actionpack/lib/action_dispatch/testing/assertions/routing.rb
の修正です。
with_routing
メソッドがActionController::API
の子クラスに対するテストで使用出来ないバグがあったのを修正しています。
Remove deprecated i18n scopes in Active Record
activerecord/lib/active_record/associations/has_many_association.rb
、
activerecord/lib/active_record/associations/has_one_association.rb
の修正です。
deprecatedになっていたactiverecord.errors.messages.restrict_dependent_destroy.one
及びactiverecord.errors.messages.restrict_dependent_destroy.many
i18n scopeを削除しています。
Remove deprecated force reload argument in association readers
activerecord/lib/active_record/associations/collection_association.rb
、
activerecord/lib/active_record/associations/singular_association.rb
の修正です。
deprecatedになっていたassociation readerメソッドのforce_reload
オプションを削除しています。
Set time as a timezone aware type and remove related deprecation
activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
の修正です。
ActiveRecord::Base.time_zone_aware_types
のデフォルトにtime
型を追加、及び、time_zone_aware_types
が設定されてない場合に出力されていたdeprecationメッセージを削除しています。
Remove deprecated support to passing a column to #quote
Active Recordの修正です。
deprecatedになっていた#quote
メソッドのcolumn
引数のサポートを削除しています。
Remove deprecated name
argument from #tables
Active Recordの修正です。
deprecatedになっていた#tables
メソッドのname
引数のサポートを削除しています。
#tables
and #table_exists?
and returns only tables and not views
https://github.com/rails/rails/commit/5973a984c369a63720c2ac18b71012b8347479a8
Active Recordの修正です。
#tables
メソッド、及び、#table_exists?
メソッドがtableのみをリターン及びチェックするよう修正しています。
合わせて、それぞれのメソッドで出していたdeprecateメッセージをまとめて削除しています。
Remove original_exception from ActiveRecord::StatementInvalid
activerecord/lib/active_record/errors.rb
、
activerecord/lib/active_record/tasks/sqlite_database_tasks.rb
の修正です。
deprecatedになっていた`ActiveRecord::StatementInvalid#initialize
、ActiveRecord::StatementInvalid#original_exception
メソッドのoriginal_exception
引数を削除しています。
Raises when ActiveRecord::Migration
is inherited directly.
activerecord/lib/active_record/migration.rb
、
activerecord/lib/active_record/migration/compatibility.rb
の修正です。
migrationクラスがActiveRecord::Migration
を直接継承していた場合、エラーがraiseするよう修正しています。今後は必ずバージョンを指定(e.g. ActiveRecord::Migration[4.2]
)する必要があります。
Raise when a through association has an ambiguous reflection name
activerecord/lib/active_record/associations.rb
、
activerecord/lib/active_record/reflection.rb
の修正です。
through associationで曖昧なreflection nameを指定した場合、AmbiguousSourceReflectionForThroughAssociation
がraiseするよう修正しています。エラーが出るような場合、source
directiveで明示的に指定する必要があります。
# before class Author < ActiveRecord::Base has_many :posts has_many :taggings, :through => :posts end class Post < ActiveRecord::Base has_one :tagging has_many :taggings end class Tagging < ActiveRecord::Base end
# after class Author < ActiveRecord::Base has_many :posts has_many :taggings, :through => :posts, :source => :tagging end class Post < ActiveRecord::Base has_one :tagging has_many :taggings end class Tagging < ActiveRecord::Base end
Rails 4.1からwarningが出るようになっていた(Ambiguous reflections are on :through relationships are no longer sup…対応がようやく削除されたようです。
Raises IrreversibleOrderError when using last with an irreversible order
activerecord/lib/active_record/relation/finder_methods.rb
の修正です。
irreversible order + last
メソッドを使用した場合、ActiveRecord::IrreversibleOrderError
をraiseするよう修正しています。
Remove deprecated support to passing a class as a value in a query
activerecord/lib/active_record/relation/predicate_builder.rb
、
activerecord/lib/active_record/relation/predicate_builder/class_handler.rb
の修正です。
deprecatedになっていたqueryにclassを値として渡した場合の処理を削除しています。
Remove deprecated support to query using commas on LIMIT
activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
、
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
deprecatedになっていたlimit
メソッドにカンマ区切りの値を指定した場合の処理を削除しています。
Remove deprecated support to passing arguments to #select
when a block is provided.
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
deprecatedになっていた#select
メソッドにblockを渡した場合の処理を削除しています。
Remove deprecated conditions parameter from #destroy_all
activerecord/lib/active_record/relation.rb
の修正です。
deprecatedになっていた#destroy_all
メソッドのconditions
引数を削除しています。
Remove deprecated conditions parameter from #delete_all
activerecord/lib/active_record/relation.rb
の修正です。
deprecatedになっていた#delete_all
メソッドのconditions
引数を削除しています。
Remove deprecated #load_schema_for
activerecord/lib/active_record/tasks/database_tasks.rb
の修正です。
deprecatedになっていた#load_schema_for
メソッドを削除しています。
Remove deprecated #raise_in_transactional_callbacks
configuration
activerecord/lib/active_record/transactions.rb
の修正です。
deprecatedになっていた#raise_in_transactional_callbacks
メソッド、#raise_in_transactional_callbacks=
メソッドを削除しています。
Remove deprecated #use_transactional_fixtures configuration
activerecord/lib/active_record/fixtures.rb
の修正です。
deprecatedになっていた#use_transactional_fixtures
configurationを削除しています。
Delayed job doesn't support Active Record 5.1 yet
activejob/Rakefile
の修正です。
Active JobのintegrationテストからDelayed Jobを削除sています。Delayed JobがまだActive Record 5.1をサポートしてない為、との事です。
Fix grammar in AR CHANGELOG.md [ci skip]
activerecord/CHANGELOG.md
の修正です。
#tables
メソッド及び#table_exists?
メソッドがtableのみをリターン及びチェックするよう修正した対応のエントリーのグラマーの修正を行っています。
Grammar linting in activerecord/CHANGELOG.md
activerecord/CHANGELOG.md
の修正です。
各エントリーのグラマー、フォーマットの修正をまとめて行っています。
Remove deprecated #insert_sql
, #update_sql
, and #delete_sql
activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
の修正です。
deprecatedになっていた#insert_sql
、#update_sql
、#delete_sql
メソッドを削除しています。
Remove deprecated #uniq
, #uniq!
, and #uniq_value
activerecord/lib/active_record/relation.rb
、
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
deprecatedになっていた#uniq
、#uniq!
、#uniq_value
メソッドを削除しています。