2014/08/26分のコミットです。
CHANGELOGへの追加はありませんでした。
[ci skip] use proper apostrophe
activesupport/test/transliterate_test.rb
のコメントの修正です。
[ci skip] make assert messages consistent
activemodel/test/cases/validations_test.rb
の修正です。
assertメソッドに指定したメッセージが実際の結果と異なっていたのを修正しています。
Use ActiveSupport::Concern instead of the traditinal way
activemodel/lib/active_model/model.rb
の修正です。
class_eval
を使用してextend/includeを行っていたのを、ActiveSupport::Concern
を使用してロードするよう修正しています。
- def self.included(base) #:nodoc: - base.class_eval do - extend ActiveModel::Naming - extend ActiveModel::Translation - include ActiveModel::Validations - include ActiveModel::Conversion - end + extend ActiveSupport::Concern + include ActiveModel::Validations + include ActiveModel::Conversion + + included do + extend ActiveModel::Naming + extend ActiveModel::Translation end
ちょっと好みがわかれそうな気もしますが…。
Quick pass through the 4.2 release notes [ci skip]
rails guideのRuby on Rails 4.2 Release Notes
の修正です。
typoの修正、改行の追加、クォーテーションの追加等を対応しています。
rails guideのRuby on Rails 4.2 Release Notes
の修正です。
Resque、Delayed Job、Sidekiqについて、githubのリンクを追加しています。
Fixed find_by("sql fragment without bindings") on master
activerecord/lib/active_record/core.rb
の修正です。
find_by
メソッドの引数チェック処理を修正しています。
- return super if current_scope || args.length > 1 || reflect_on_all_aggregations.any? + return super if current_scope || !(Hash === args.first) || reflect_on_all_aggregations.any?
元々は、argsの長さをチェックしていたのを、型チェックを行うように変更しています。
Todo.all.find_by("id = ?", 1)
こんな使い方をした場合に、find_by
メソッド内で処理を行えるようにする為、だとは思うのですが、何故この対応が必要かはよく解らず…。
Override #find_by! in core to enable AST caching
activerecord/lib/active_record/core.rb
の修正です。
Core
モジュールにfind_by!
メソッドを定義しています。ASTキャッシングの為との事です。
Merge pull request #16646 from sgrif/sg-perf-regression
activerecord/lib/active_record/attribute_methods/dirty.rb
の修正です。
changed_attributes
の値をcacheするよう修正しています。
[ci skip] Added documentation for has_and_belongs_to_many extension parameter
activerecord/lib/active_record/associations.rb
のdocの修正です。
has_and_belongs_to_manyのエクステンションにパラメータを渡す場合のサンプルを追加しています。
has_and_belongs_to_many :contractors do def find_or_create_by_name(name) first_name, last_name = name.split(" ", 2) find_or_create_by(first_name: first_name, last_name: last_name) end end
ActiveJobの修正です。
require
していた各adapterのロード処理を、autoload
で自動的に読み込むよう修正しています。