2014/07/29分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
actionmailer/CHANGELOG.md
Merge pull request #16303 from rajcybage/removing_master
actionpack/test/dispatch/debug_exceptions_test.rb
のdocの修正です。
使用していないメソッドがあるのですが、そのメソッドがRack SPECで必要な旨追加コメントを追加しています。
RackのSPECはこちら。
docs, clarify attribute query methods on numeric columns. Closes #16246.
activerecord/lib/active_record/base.rb
のdocの修正です。
numericカラムについて、0じゃない場合にpresent
が定義される旨説明を追加しています。
Fix typo and remove code block since present is not a method.
activerecord/lib/active_record/base.rb
の修正です。
先のコミットでtypoがあったのを修正しています。
ActiveRecordのtransaction処理のリファクタリングです。
トランザクションの状態を管理する為のTransactionManager
クラスを新設に、トランザクション関係の処理はそちらに集約しています。
savepoint_name should return nil for non-savepoint transactions
ActiveRecordのtransaction処理の修正です。
savepoint transactionじゃない場合、savepoint_name
メソッドがnilを返すよう修正しています。
Extract the transaction class to a local variable
activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
の修正です。
transactionsクラスをローカル変数に格納しています。
- transaction = - if @stack.empty? - RealTransaction.new(@connection, current_transaction, options) - else - SavepointTransaction.new(@connection, current_transaction, options) - end + transaction_class = @stack.empty? ? RealTransaction : SavepointTransaction + transaction = transaction_class.new(@connection, current_transaction, options)
ちょいリファクタリング。
actionpack/lib/action_dispatch/routing/url_for.rb
の修正です。
optimize_routes_generation?
メソッドでインスンタンス変数に値をキャッシュしていたのを止めています。
- return @_optimized_routes if defined?(@_optimized_routes) - @_optimized_routes = _routes.optimize_routes_generation? && default_url_options.empty? + _routes.optimize_routes_generation? && default_url_options.empty?
このキャッシュは性能の改善にはならないのに、複雑になってしまっているので、キャッシュを削除したとの事です。
actionpack/lib/action_dispatch/routing/mapper.rb
、
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
不要なmounted?
メソッドを削除しています。
remove blank lines in the start of the ActiveRecord files
ActiveRecordの各ファイルの先頭にあった不要な空行を削除しています。
Move object test files under object
Objectクラスのテストをactivesupport/test/core_ext/object/
配下に移動しています。
Give password_confirmation div the "field" class in erb form template
railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb
の修正です。
scaffoldで生成されるtemplateからclass="field"
が漏れていたのを追加しています。
Added failing test case for #16131
activesupport/test/core_ext/object/json_cherry_pick_test.rb
の修正です。
oj
とmulti_json
と一緒にactive_support/core_ext/object
を使用した際に、エラーになる問題があったらしく、その確認の為のテストを追加しています。
Fixed a compatibility issue with the Oj
gem
activesupport/lib/active_support/core_ext/object/json.rb
の修正です。
先にテストを上げた問題について対応しています。
active_support/json
をloadせずにactive_support/core_ext/object/json
を使用した場合に問題があったようです。
- if ActiveSupport.use_standard_json_time_format + if ActiveSupport::JSON::Encoding.use_standard_json_time_format
active_support/jsonがロードされるよう、autoloadのトリガーを修正しています。
Raise an exception when attachments are added after mail
was called.
actionmailer/lib/action_mailer/base.rb
の修正です。
mail
メソッドを呼び出した後にattachments
を設定した場合にRuntimeError
がraiseされるよう対応しています。
class LateAttachmentMailer < ActionMailer::Base def welcome mail body: "yay", from: "welcome@example.com", to: "to@example.com" attachments['invoice.pdf'] = 'This is test File content' end end
上記のようなケースがエラーになるようになっています。そもそも、正常に動作してなかったので、問題がを起きている事を明確にする為に、Errorを起こすようにしたようです。
class LateAttachmentAccessorMailer < ActionMailer::Base def welcome attachments['invoice.pdf'] = 'This is test File content' mail body: "yay", from: "welcome@example.com", to: "to@example.com" end end
attachmentsが先のケースは当然OKです。
[ci skip] fix doc typo for validates_uniqueness_of
activerecord/lib/active_record/validations/uniqueness.rb
のdocの修正です。
typoを修正しています。
Move array test files under array
activesupport/test/core_ext
配下にあったArray関係のテストをactivesupport/test/core_ext/array
配下に移動しています。
docs, cleanup mixed indents within form_options_helper.rb
RDoc.
actionview/lib/action_view/helpers/form_options_helper.rb
のdocの修正です。
不要なスペースの削除、インデントの整理等々を実施しています。
activesupport/test/core_ext/array/conversions_test.rb
の修正です。
Array#to_sentence
メソッドのテストが無かったのを追加しています。合わせて、Object#to_param
メソッドのテストを適切な箇所に移動しています。
Remove @state.parent assignment on commit
activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
の修正です。
@state.parent
に値を設定する処理を削除しています。
元々はコミットがされたかどうかのチェックに使用していたようなのですが、こちらのコミットから使用されなくなったので、削除したようです。