2015/01/04分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
before callback chainを停止させる条件がfalse
をreturnする事から、throw(:abort)
する事に変更するPRがマージされており、以下のCHANGELOGはすべてその変更に関するCHANGELOGです。その為、リンク先はすべて同じPRへのリンクになっています。
activemodel/CHANGELOG.md
- Change the way in which callback chains can be halted.
- Add Callbacks::CallbackChain.halt_and_display_warning_on_return_false
- Add
config/initializers/callback_terminator.rb
- Add Callbacks::CallbackChain.halt_and_display_warning_on_return_false
callbackに関するCHANGELOGはここまで。ここからすべて、deprecateになっていたメソッド/クラスの削除、挙動の変更に関するCHANGELOGです。
- Remove deprecated ActiveSupport::Cache::Store.instrument
- Remove deprecated core_ext/big_decimal/yaml_conversions file
- Remove deprecated methods at
Kernel
. - Remove deprecated
ActiveSupport::SafeBuffer#prepend
- Remove deprecated ActiveSupport::JSON::Encoding.encode_big_decimal_as_string=
- Remove deprecated ActiveSupport::JSON::Encoding::CircularReferenceError.
- Change the default test order from
:sorted
to:random
actionmailer/CHANGELOG.md
- Remove deprecated option
use_route
in controller tests - Remove deprecated
ActionDispatch::Http::Parameters#symbolized_path_parameters
- Remove deprecated
ActionDispatch::Request#deep_munge
- Remove deprecated
ActionDispatch::Response#to_ary
- Remove deprecated support to define routes with
:to
option that - Remove deprecated
NamedRouteCollection#helpers
- Remove deprecated
only_path
option on*_path
helpers - Remove deprecated usage of string keys in URL helpers
- Remove deprecated assertion files
- Remove deprecated
AbstractController::Base::parent_prefixes
- Change the default template handler from
ERB
toRaw
.
activemodel/CHANGELOG.md
- Remove deprecated automatic counter caches on
has_many :through
- Remove
cache_attributes
and friends - Remove deprecated
serialized_attributes
- Return a null column from
column_for_attribute
when no column exists. - Return an array of pools from
connection_pools
- Change the default
null
value fortimestamps
tofalse
- Remove deprecated access to connection specification using a string acessor.
- Remove deprecated
ActiveRecord::Base.disable_implicit_join_references=
- Remove deprecated
symbolized_base_class
andsymbolized_sti_name
- Remove deprecated
Reflection#source_macro
- Remove deprecated
sanitize_sql_hash_for_conditions
- Change transaction callbacks to not swallowing errors.
- Change the behavior of boolean columns to be closer to Ruby's semantics.
各コンポーネントのdocのタイポを修正しています。
Remove the tmp/sessions folder and its clear task
railties/lib/rails/commands/server.rb
、railties/lib/rails/tasks/tmp.rake
及び各guideの修正です。
tmp/sessions
ディレクトリを作成しないよう修正、及びtmp/sessions
ディレクトリについての説明をraiils guideから削除しています。
session情報保持用に作ったと思われるのですが、現在使って無いので削除したとの事です。
railties/test/application/configuration_test.rb
の修正です。
rails applicationを保持している変数名をapp
-> application
に修正しています。
warningsを取り除く為との事なので、変数名がバッティングした為ですかねえ。
Merge pull request #17227 from claudiob/explicitly-abort-callbacks
callback処理の修正です。before callback chainを停止させる条件がfalse
をreturnする事から、throw(:abort)
する事に変更になっています。
Rails 4.2までは、ActiveRecord, ActiveModel and ActiveModel::Validationsのbefore callback で呼ばれた処理の戻り値がfalse
だった場合、callback chainを途中で停止するようになっていました。
class Post < ActiveRecord::Base before_save { |post| puts "Callback 1"; false } before_save { |post| puts "Callback 2" } after_save { |post| puts "Callback 3" } end # Inside a new Rails 4.2 app post = Post.new post.save # Callback 1 # => false
Rails 5.0以降ではこの挙動が代わり、false
をreturnしてもcallback chainが停止しないようになっています。
# Inside a new Rails 5.0 app post = Post.new post.save # Callback 1 # Callback 2 # Callback 3 # => true
なお、上記は新規でapplicationを作成した場合のケースで、過去バージョンからのアップグレードの場合は、false
をreturnした場合にcallback chainを停止する挙動はそのままで、deprecationメッセージが表示されるようになります。
# Inside a Rails 4.2 app upgraded to Rails 5.0 post = Post.new post.save # Callback 1 # DEPRECATION WARNING: Returning `false` in a callback will not implicitly halt a callback chain in the next release of Rails. To explicitly halt a callback chain, please use `throw :abort` instead. # => false
false
をreturnした場合に、callback chainを停止する/しないの挙動は、config.active_support.halt_callback_chains_on_return_false
で変化し、
throw :abort
への対応が完了したら、halt_callback_chains_on_return_false
にfalse
を設定してあげれはOKとの事です。
Update bug report templates to use version 4.2.0 instead of 5.0.0 [ci skip]
guides/bug_report_templates/action_controller_gem.rb
、
guides/bug_report_templates/active_record_gem.rb
の修正です。
railsのバージョンを5.0.0 -> 4.2.0に戻しています。リリースされているgemの最新のバージョンは4.2.0の為との事。
Remove deprecated ActiveSupport::Cache::Store.instrument
activesupport/lib/active_support/cache.rb
の修正です。
deprecateになっていたActiveSupport::Cache::Store.instrument
メソッドを削除しています。
Remove deprecated core_ext/big_decimal/yaml_conversions file
deprecateになっていたactivesupport/lib/active_support/core_ext/big_decimal/yaml_conversions.rb
を削除しています。
Remove deprecated methods at Kernel
.
activesupport/lib/active_support/core_ext/kernel/reporting.rb
の修正です。
deprecateになっていたKernel#silence_stderr
、Kernel#silence_stream
、Kernel#capture
、Kernel#quietly
メソッドを削除しています。
Remove deprecated ActiveSupport::SafeBuffer#prepend
activesupport/lib/active_support/core_ext/string/output_safety.rb
の修正です。
deprecateになっていたActiveSupport::SafeBuffer#prepend
メソッドを削除しています。
Remove deprecated ActiveSupport::JSON::Encoding.encode_big_decimal_as_string=
activesupport/lib/active_support/json/encoding.rb
の修正です。
deprecateになっていたActiveSupport::JSON::Encoding.encode_big_decimal_as_string
メソッドを削除しています。
Remove deprecated ActiveSupport::JSON::Encoding::CircularReferenceError.
activesupport/lib/active_support/json/encoding.rb
の修正です。
deprecateになっていたActiveSupport::JSON::Encoding::CircularReferenceError
クラスを削除しています。
Change the default test order from :sorted
to :random
activesupport/lib/active_support/test_case.rb
の修正です。
test orderのデフォルトを:sorted
から:random
に修正しています。
Remove deprecated ActionMailer deliver & deliver!
actionmailer/lib/action_mailer/message_delivery.rb
の修正です。
deprecateになっていたMessageDelivery#deliver
、MessageDelivery#deliver!
メソッドを削除しています。
Remove deprecated option use_route
in controller tests
actionpack/lib/action_controller/test_case.rb
の修正です。
deprecateになっていたcontrollerのテストでのuse_route
オプションを削除しています。
Remove deprecated ActionDispatch::Http::Parameters#symbolized_path_parameters
actionpack/lib/action_dispatch/http/parameters.rb
の修正です。
deprecateになっていたActionDispatch::Http::Parameters#symbolized_path_parameters
メソッドを削除しています。
Remove deprecated ActionDispatch::Request#deep_munge
actionpack/lib/action_dispatch/http/request.rb
の修正です。
deprecateになっていたActionDispatch::Request#deep_munge
メソッドを削除しています。
Remove deprecated ActionDispatch::Response#to_ary
actionpack/lib/action_dispatch/http/response.rb
の修正です。
deprecatedになっていたActionDispatch::Response#to_ary
メソッドを削除しています。
Remove deprecated support to define routes with :to
option that
actionpack/lib/action_dispatch/routing/mapper.rb
の修正です。
deprecateになっていた、routeのto
オプションに"#"を含まない値を設定された場合の処理を削除しています。
Remove deprecated NamedRouteCollection#helpers
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
NamedRouteCollection#helpers
メソッドを削除しています。
Remove deprecate *_path
helpers in email views
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
deprecateになっていたemailのviewで*_path
helperメソッドを使用された場合の処理を削除しています。
Remove deprecated only_path
option on *_path
helpers
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
deprecateになっていた*_path
helperメソッドのonly_path
オプションを削除しています。
Remove deprecated usage of string keys in URL helpers
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
deprecateになっていたURL helperメソッドのkeyにStringクラスを使用した場合の処理を削除しています。
Remove deprecated assertion files
deprecateになっていた
actionpack/lib/action_dispatch/testing/assertions/dom.rb
、
actionpack/lib/action_dispatch/testing/assertions/selector.rb
、
actionpack/lib/action_dispatch/testing/assertions/tag.rb
を削除しています。
Remove deprecated AbstractController::Base::parent_prefixes
actionview/lib/action_view/view_paths.rb
の修正です。
deprecateになっていたAbstractController::Base::parent_prefixes
メソッドを削除しています。
Change the default template handler from ERB
to Raw
.
actionview/lib/action_view/template/handlers.rb
の修正です。
default template handlerがERB
からRaw
に変更になっています。拡張子の指定が無い場合、今後は"raw"ファイルとして処理が行われます。
Remove deprecated ActiveModel::Dirty#reset_#{attribute}
and ActiveModel::Dirty#reset_changes
.
deprecateになっていたActiveModel::Dirty#reset_#{attribute}
、ActiveModel::Dirty#reset_changes
メソッドを削除しています。
Remove deprecated automatic counter caches on has_many :through
activerecord/lib/active_record/associations/has_many_through_association.rb
の修正です。
deprecateになっていた、has_many :through
アソシエーションを使用している場合に自動でcounter cacheの値の更新を行う処理を削除しています。
Remove cache_attributes
and friends
activerecord/lib/active_record/attribute_methods/read.rb
の修正です。
deprecateになっていたcache_attributes
、cached_attributes
, cache_attribute?
メソッドを削除しています。
Remove deprecated serialized_attributes
activerecord/lib/active_record/attribute_methods/serialization.rb
の修正です。
deprecateになっていたserialized_attributes
メソッドを削除しています。
Return a null column from column_for_attribute
when no column exists.
activerecord/lib/active_record/associations/preloader/association.rb
の修正です。
column_for_attribute
の引数に存在しないカラムを指定した場合、ActiveRecord::ConnectionAdapters::NullColumn
クラスを返すよう修正しています。
Return an array of pools from connection_pools
activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
の修正です。
connection_pools
メソッドがconnection_pool_list
のエイリアスとなりArrayを返すよう修正しています。
Change the default null
value for timestamps
to false
activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
の修正です。
schemaのtimestamps
メソッドのデフォルトがnull: true
からnull: false
に変更になっています。
Remove deprecated access to connection specification using a string acessor.
activerecord/lib/active_record/connection_adapters/connection_specification.rb
の修正です。
deprecateになっていた、DBのconnection 定義をstring acessor経由で取得する処理を削除しています。
Remove deprecated ActiveRecord::Base.disable_implicit_join_references=
activerecord/lib/active_record/core.rb
の修正です。
deprecateになっていたActiveRecord::Base.disable_implicit_join_references=
メソッドを削除しています。
Remove deprecated ActiveRecord::Fixtures
constant
activerecord/lib/active_record/fixtures.rb
の修正です。
deprecateになっていたActiveRecord::Fixtures
を削除しています。
Remove deprecated symbolized_base_class
and symbolized_sti_name
activerecord/lib/active_record/inheritance.rb
の修正です。
deprecateになっていたsymbolized_base_class
、symbolized_sti_name
メソッドを削除しています。
Remove deprecated Reflection#source_macro
activerecord/lib/active_record/reflection.rb
の修正です。
deprecateになっていたReflection#source_macro
メソッドを削除しています。
Remove deprecated sanitize_sql_hash_for_conditions
activerecord/lib/active_record/sanitization.rb
の修正です。
deprecateになっていたsanitize_sql_hash_for_conditions
メソッドを削除しています。
Change transaction callbacks to not swallowing errors.
activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
、
activerecord/lib/active_record/transactions.rb
の修正です。
deprecateになっていたActiveRecord::Base.errors_in_transactional_callbacks=
メソッドの削除及び
transaction callbacksでエラーがおきた際、エラーを握りつぶさないよう挙動を修正しています。
Change the behavior of boolean columns to be closer to Ruby's semantics.
activerecord/lib/active_record/type/boolean.rb
の修正です。
boolean columnsの挙動をRubyの挙動に合わせるよう修正しています。
もともと、true値のリストを保持し、そこに値が一致した場合のみtrueと判定したのですが、今後は逆にfalse値のリストの判定のみ行い、一致しない場合trueとみなされるようになります。
具体的には、falseとみなされていた、' '、"\u3000\r\n"、"\u0000"、 'SOMETHING RANDOM' 等の値がtrueと判定される事になります。
因みに、falseとみなす値リストは以下の通りです。
[false, 0, '0', 'f', 'F', 'false', 'FALSE', 'off', 'OFF']