2014/12/30分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
eager_load
preserves readonly flag for associations- Ensure
first!
and friends work on loaded associations - AR specific length validator to respect
marked_for_destruction
.
actionmailer/CHANGELOG.md
Just check if the buffer exists before changing it
activesupport/lib/active_support/core_ext/string/output_safety.rb
の修正です。
先日行われたhtml_safe
のnilチェックのリファクタリングを行っています。
- unless new_safe_buffer.respond_to?(:frozen?) && new_safe_buffer.frozen? + + if new_safe_buffer
frozen
チェックはやめて、ifでの判定だけにしています。
eager_load
preserves readonly flag for associations
activerecord/lib/active_record/associations/join_dependency.rb
の修正です。
eager_load
をした際、associationのreadonly flagを保持するよう修正しています。
plugin's gemfile also needs tzinfo-data in Windows
railties/lib/rails/generators/rails/plugin/templates/Gemfile
の修正です。
Windowsの場合、Gemfileにtzinfo-data
を追加するよう修正しています。
Add nodoc to touch at no_touching.rb
activerecord/lib/active_record/no_touching.rb
の修正です。
touch
メソッドに:nodoc:を追加しています。
Rely on the injectable type caster for arel_table
ActiveRecordの修正です。
Arel::Table
のインスタンス生成時に、type_caster
を設定するよう修正しています。
DBからの型変換処理を呼び出すのはarel側にして、ActiveRecord側は変換処理を定義したクラスを渡す形にしています。
Extract an explicit type caster class
ActiveRecordの修正です。
TypeCaster::Connection
、TypeCaster::Map
クラスを新規に作成しています。
型変換処理用のクラスですかねえ。
activerecord/test/cases/relation/where_chain_test.rb
の修正です。
先の対応でコケたテストを修正しています。
Pass a type caster when aliasing tables for joins
ActiveRecordの修正です。
Arel::Tableのインスタンスを作成する際に、TypeCasterを渡すよう修正しています。
Remove all cases of manuallly wrapping Arel::Nodes::Quoted
ActiveRecordの修正です。
値をArel::Nodes::Quoted
でラップしていた箇所をすべて削除しています。
Arel Tableにtype casterを渡すようにしたので、こちらの対応は不要との事です。
activerecord/activerecord.gemspec
の修正です。
使用するarelのバージョンを7.0.0.alpha
に修正しています。
Ensure first!
and friends work on loaded associations
activerecord/lib/active_record/associations/collection_proxy.rb
の修正です。
loadしたassociationに対してfirst!
メソッドを呼び出した際に、NoMethodError
になってしまうバグがあったのを修正しています。second!
、third!
等も同様との事です。
Remove some warning with Ruby 2.2
railties/test/generators/actions_test.rb
の修正です。
Ruby 2.2で"unused literal ignored"が出てたのを対応しています。
- '# This wont be added' + _ = '# This wont be added'# assignment to silence parse-time warning "unused literal ignored"
rails guideのAction Mailer Basics
の修正です。
ActionMailer::Base.register_interceptorのexampleが、一行で記載するには長すぎるとの事で、複数行に分けています。
-ActionMailer::Base.register_interceptor(SandboxEmailInterceptor) if Rails.env.staging? +if Rails.env.staging? + ActionMailer::Base.register_interceptor(SandboxEmailInterceptor) +end
Removed Object#itself as it's implemented in ruby 2.2
activesupport/lib/active_support/core_ext/object.rb
、
activesupport/lib/active_support/core_ext/object/itself.rb
の修正です。
Object#itself
を削除しています。Ruby 2.2で同名のメソッドがあるからですね。
Rephrase functional testing in its relation to Rails Controller Unit Testing.
rails guideのA Guide to Testing Rails Applications
の修正です。
Functional Tests for Your Controllers
の項の言い回しを修正しています。
Document the include_all_helpers config setting.
rails guideのConfiguring Rails Applications
の修正です。
config.action_controller.include_all_helpers
についての説明を追加しています。
Compare http request type with test equivalent methods, and application use-cases.
HTTPメソッドについて説明している箇所を修正しています。
Rephrase Four Hashes of the Apocalypse [ci skip]
rails guideのA Guide to Testing Rails Applications
の修正です。
The Four Hashes of the Apocalypse
の項の言い回しを修正しています。
These are technically objects [ci skip]
rails guideのA Guide to Testing Rails Applications
の修正です。
@request
、@response
について説明している箇所に、それぞれオブジェクトである旨説明を追加しています。
Pass through Testing Templates and Layouts section [ci skip]
rails guideのA Guide to Testing Rails Applications
の修正です。
Testing Templates and Layouts
項全体のグラマー、言い回し等の修正を行っています。
Implement testing flash
notices into our blog app [ci skip]
rails guideのA Guide to Testing Rails Applications
の修正です。
flash
のテストのやり方についての説明を追加しています。
Add doc for :touch
option of AR::Base#save
activerecord/lib/active_record/persistence.rb
のdocの修正です。
ActiveRecord:::Base#saveメソッドの、touch
オプションについての説明を追加しています。
Pass through assert_select
testing guide [ci skip]
rails guideのA Guide to Testing Rails Applications
の修正です。
assert_select
メソッドについて説明している箇所全体のグラマー、言い回し等の修正を行っています。
Update link to rails-dom-testing documentation [ci skip]
rails guideのA Guide to Testing Rails Applications
の修正です。
rails-dom-testing
のdocのリンクをgithubからrubydocに修正しています。
Remove pre-4.2 comment about missing assert_select
[ci skip]
rails guideのA Guide to Testing Rails Applications
の修正です。
不要なassert_select
についてのNOTEを削除しています。
fix error message of option as with invalid charters in partial rendering
actionview/lib/action_view/renderer/partial_renderer.rb
の修正です。
render
メソッドのas
オプションに不正な値を指定した場合に、適切なエラーメッセージを表示するよう修正しています。
@view.render(:partial => "test/a-in", :as => 'a-in') # => "The value (a-in) of the option `as` is not a valid Ruby identifier; make sure it starts with lowercase letter, and is followed by any combination of letters, numbers and underscores."
Grammar pass through Integration Testing section [ci skip]
rails guideのA Guide to Testing Rails Applications
の修正です。
Integration Testing
セクション全体のグラマーの修正を行っています。
Move longer form example from integration guide to api reference, below an
actionpack/lib/action_dispatch/testing/integration.rb
のdocの修正です。
Testing guideに記載されていたIntegration TestのexampleをIntegrationTest
クラスのdocに移動しています。
Remove redundant information about Minitest, which is already covered when
rails guideのA Guide to Testing Rails Applications
の修正です。
A Brief Note About Minitest
の項を削除しています。 そこまでのguideの説明で、既に同じ内容を記載している為との事。
Condense notes regarding Minitest and its available assertions removed in:
rails guideのA Guide to Testing Rails Applications
の修正です。
Minitestについての説明を追加、及びMinitestのassertionメソッドを一通り記載していたのを削除しています。assertionメソッドについては、API docの方を見てとの事。
Fix form_for to work with objects that implement to_model
actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
の修正です。
form_for
メソッドの引数にto_model
メソッドを適切に実装したオブジェクトを指定した場合、4.1では正常に動作していたのが、4.2で動作しなくなってしまっていたのを、再度動作するよう修正しています。
Move Rake tasks list to a smaller heading section earlier in the guide.
rails guideのA Guide to Testing Rails Applications
の修正です。
Rake Tasks for Running your Tests
の項をguide内のより適切な位置に移動しています。
Template lookup now respect default locale and I18n fallbacks.
actionmailer/lib/action_mailer/base.rb
の修正です。
mailerのtemplateを検索する際、デフォルトのロケールを参照するよう修正しています。
mailer/demo.html.erb mailer/demo.en.html.erb mailer/demo.pt.html.erb
上記テンプレートがあった場合、デフォルトロケールに"en"が設定されていてもdemo.html.erb
がレンダリングされていたのが、
最初にdemo.en.html.rb
をレンダリングするよう修正しています。レイアウトファイルも同様です。
AR specific length validator to respect marked_for_destruction
.
activerecord/lib/active_record/validations/length.rb
の修正です。
validates_size_of
/ validates_length_of
がレコードのカウントではなく、marked_for_destruction?
の数をカウントするよう修正しています。
オブジェクトの削除を行った際、レコードでカウントしていると削除予定のレコードもカウントされてしまい、期待通りのvalidateが設定されないので、
marked_for_destruction
の方をカウントするようにしたとの事です。
このバグ、最初に起票されたのが2009年5月だったので、五年越しでの対応との事です