2017/04/21分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activejob/CHANGELOG.md
Namespace CSS selectors on error pages
railties/lib/rails/generators/rails/app/templates/public/404.html
、
railties/lib/rails/generators/rails/app/templates/public/422.html
、
railties/lib/rails/generators/rails/app/templates/public/500.html
の修正です。
デフォルトのエラーページでスタイルをあてる際に、bodyタグやh1タグに直接スタイルをあてていたのを、エラー表示用のクラスを作成し、そちらを使用するよう修正しています。
-<body> +<body class="rails-default-error-page">
bodyに直接スタイルを指定してしまうと、Turbolinksを使っている場合に問題がある為(エラーページを表示して、前のページに戻った際に、bodyタグのスタイルがそのまま残ってしまうケースがある)為対応したとの事です。
Fixes Hash.from_xml with frozen strings for all backends
Active Supportの修正です。
Hash.from_xml
にfreeze済みのStringを渡した場合にエラーになってしまうバグがあったのを修正しています。IO#ungetc
を使っているのが問題だった為、使用しないよう修正しています。
Merge pull request #28582 from sbull/activejob-error-logging
activejob/lib/active_job/logging.rb
の修正です。
Active Jobでjob実行時のログを取得する際に、エラーが発生した場合はそのエラーの情報をログに出力するよう修正しています。
例。
Performing GuestJob (Job ID: eea34ed0-106b-4cfa-8e56-4a3c55244417) from Async(default) with arguments: "dummy" Error performing GuestJob (Job ID: eea34ed0-106b-4cfa-8e56-4a3c55244417) from Async(default) in 0.14ms: RuntimeError (Dummy!): /home/yaginuma/program/rails/master/app/jobs/guest_job.rb:5:in `perform' /home/yaginuma/program/rails/master_y_yagi/rails/activejob/lib/active_job/execution.rb:37:in `block in perform_now' /home/yaginuma/program/rails/master_y_yagi/rails/activesupport/lib/active_support/callbacks.rb:108:in `block in run_callbacks' /home/yaginuma/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/i18n-0.8.1/lib/i18n.rb:257:in `with_locale' ...
backtraceがそのまま全て表示されるようになっています。
Merge pull request #28681 from runephilosof/fix-mysql-grant
activerecord/lib/active_record/tasks/mysql_database_tasks.rb
の修正です。
db:create
taskでGRANTステートメントを発行する際に、database名をエスケープするよう修正しています。
Prevent double firing the before save callback of new object when the parent association saved in the callback https://github.com/rails/rails/commit/c0038f7c362fa0c92fc9e1ea3bdb2706f42386c6
Active Recordの修正です。
has_manyの子モデルのbefore_save内で親レコードをsaveするcallbackを仕込んでると、子レコードをsaveするときsave完了前にcallback内の親レコードから子レコードのbefore_saveがもう一回発火してしまうバグがあったのを修正しています。
activesupport/lib/active_support/core_ext/enumerable.rb
のdocの修正です。
Enumerable
module内のdocのコメントにカンマを追加しています。
activejob/test/cases/logging_test.rb
の修正です。
不足していたjobs/rescue_job
のrequireを追加しています。
Don’t attempt to create a new record that was already created.
activerecord/lib/active_record/autosave_association.rb
の修正です。
association同士でhas_and_belongs_to_many
を設定していた場合に、データ保存時に複数レコードが生成されてしまうバグがあったのを修正しています。
class Organisation < ActiveRecord::Base has_one :user end class User < ActiveRecord::Base has_and_belongs_to_many :roles belongs_to :organisation end class Role < ActiveRecord::Base has_and_belongs_to_many :users end user = User.new user.organisation = Organisation.new user.roles << Role.new user.save! User.first.roles.count # => 1になるべきが、2になってしまっていた
Merge pull request #28432 from marksiemers/master
rails guideのForm Helpers
の修正です。
Building Complex Forms
の項のmodelのexampleコードに、inverse_of
オプションを追加しています。inverse_of
の指定が無いと、以降のexampleコードが正しく動作しない為。
Add test case to make sure we can implicit convert a Parameters to a Hash
actionpack/test/controller/parameters/parameters_permit_test.rb
の修正です。
ActionController::Parameters
が暗黙的にHash
に変換される事を確認する為のテストを追加しています。