2014/08/25分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
[ci skip] Added documentation for has_many extension parameter
activerecord/lib/active_record/associations.rb
のdocの修正です。
has_many scopeにパラメータを渡すサンプルを追加しています。
has_many :employees 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
Grammer and spelling pass on web console release note. [CI SKIP]
rails guideのRuby on Rails 4.2 Release Notes
の修正です
グラマー及びスペルミスの修正です。
activesupport/lib/active_support/duration.rb
の修正です。
instance_of?
メソッドでクラスで保持しているvalueとのinstance_of?
チェックも追加しています。
- Duration == klass + Duration == klass || value.instance_of?(klass)
PRのコメント見た感じだと、下位互換を壊してしまうっていたので、処理を修正した感じのようです。
Skip #eql? tests on Rubinius for AS::Duration
activesupport/test/core_ext/duration_test.rb
の修正です。
eql?
メソッドのテストについて、Rubiniusの場合のみスキップするよう対応しています。
Rubiniusのeql?
メソッドはinstance_of?
メソッドに依存しており、先に対応したinstance_of?
メソッドの対応でテストがコケてしまうので、一旦スキップするよう対応したようです。
activejob/lib/active_job/arguments.rb
、
activerecord/lib/active_record/associations.rb
の修正です。
typoの修正。
Some tweaks to the development set-up guide
rails guideのDevelopment Dependencies Install
の修正です。
- libxml2 とlibxsltの説明について削除。Nokogiriに含まれてるとの事。
- Arch Linux、FreeBSDの場合のmemcachedのインストール手順追加
- 新しい
pkg install
シンタックスに対応 - 重複しているHomebrewへのリンクを削除
等々。
Whoops, duplicated word [ci skip]
rails guideのDevelopment Dependencies Install
の修正です。
typoの修正です。
treetop is no longer a mail (rails) dependency
rails guideのThe Rails Initialization Process
の修正です。
Railsが使用しているgemの説明から、polyglot
、treetop
を削除しています。
Address comments on Gzip implementation
actionpack/lib/action_dispatch/middleware/static.rb
の修正です。
Gzip対応のPRで指摘されたコメントに対する対応です。リファクタリング。
[ActiveJob] Add activesupport as dependency [ci skip]
activejob/activejob.gemspec
の修正です。
dependencyにactivesupport
を追加しています。
Merge pull request #16639 from agrobbin/input-placeholder-i18n
デグレに対応したinput/textarea placeholder textへのi18nサポート対応を、再度コミットしています。
pg, default_sequence_name
needs to return a string.
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
の修正です。
default_sequence_name
メソッドがStringを返すよう修正しています。
元々Stringを返す仕様で4.2.beta1で仕様が変わったのですが、sequence_name
はpublic APIなので、型は変わらない方が良いだろうという事で、Stringに戻しています。
実際、seed-fuがこの影響で動かなくなったりしていたようです。
Merge pull request #16488 from agrobbin/form-label-builder
actionview/lib/action_view/helpers/tags/label.rb
の修正です。
label
メソッド用のbuilderとして、LabelBuilder
クラスを新規に作成しています。
このLabelBuilder
クラスはi18nに対応した値を返す為の、translation
メソッドが提供されています。
テストから抜粋。
label(:post, :body) { |b| "<b>#{b.translation}</b>".html_safe } # => '<label for="post_body"><b>Write entire text here</b></label>'
i18n対応が必要な時には便利そうですね。