2015/02/13分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Allow
:precision
option for time type columns. - Optimize none? and one? relation query methods to use LIMIT and COUNT.
activemodel/CHANGELOG.md
Merge pull request #18885 from ypxing/master
activesupport/lib/active_support/callbacks.rb
の修正です。
halting_and_conditional
メソッドのコールバック処理内で行っていた、不要な変数への代入処理を削除しています。
Merge pull request #18886 from kamipo/allow_precision_option_for_time_column
ActiveRecordの修正です。
time 型のカラムにprecision
オプションを指定出来るよう対応しています。
Merge pull request #11790 from printercu/patch-3
actionpack/lib/abstract_controller/translation.rb
の修正です。
ActionController#translate
の引数にSymbolを渡せるよう対応しています。
t(:'.no_action')
こんな形で渡せるようになっています。
Merge pull request #18844 from yuki24/guides-add-render-example-without-partial-and-locals
rails guideのAction View Overview
の修正です。
render
メソッドにpartial
及びlocals
オプションを渡さずに使用する場合の説明を追加しています。
ActiveRecordの修正です。datetime precisionについてのテストが各adapters毎に同じ内容が定義されてしまっていたので、重複しているテストをDateTimePrecisionTest
クラスに切り出しています。
Optimize none? and one? relation query methods to use LIMIT and COUNT.
ActiveRecordの修正です。
block
、limit
が指定されてない場合に、none?
メソッドがLIMIT 1
を、one?
メソッドがCOUNT
をそれぞれ使用するよう修正しています。
# Before: users.none? # => SELECT "users".* FROM "users" users.one? # => SELECT "users".* FROM "users" # After: users.none? # => SELECT 1 AS one FROM "users" LIMIT 1 users.one? # => SELECT COUNT(*) FROM "users"
Skip url_helpers instead of caching, speed up integration tests
actionpack/lib/action_dispatch/routing/route_set.rb
、
actionpack/lib/action_dispatch/testing/integration.rb
の修正です。
integration testでurl_helpers
の値をキャッシュしていたのを止めて、代わりにrespond_to?
の結果をメモ化するよう修正しています。性能改善の為。
use before_setup to set up test instance variables
actionpack/lib/action_dispatch/testing/integration.rb
の修正です。
インスタンス変数の生成処理をbefore_setup
内で行うよう修正しています。
lazily create the integration session
actionpack/lib/action_dispatch/testing/integration.rb
の修正です。
必要になった際にintegration_session
を生成するよう修正していまう。合わせて、不要になったsessionのreset処理を削除しています。
there is always an integration session, so remove the check
actionpack/lib/action_dispatch/testing/integration.rb
の修正です。
copy_session_variables!
メソッドから@integration_session
のチェック処理を削除しています。
actionpack/lib/action_dispatch/testing/integration.rb
の修正です。
instance_variable_set
メソッドで行っていたインスタンス変数への値の設定処理を、普通の代入式を使用するよう修正しています。
記述の為の行数が変わらないし、また、メタプロ無しの方が速い為との事。
require rack/utils in exception_wrapper
actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
の修正です。
不足していたrack/utils
のrequireを追加しています。
rails guideのAction Controller Overview
の修正です。
Other Ways to Use Filters
の項で、_
へのエスケープが足りてなかったので、追加しています。
Do not recommend xhr
since it is going to be deprecated.
actionpack/lib/action_dispatch/testing/integration.rb
の修正です。
ActionDispatch::IntegrationTest
のHTTP request methodsでキーワード引数を使用していない場合に出力されるwarningメッセージに、deprecateになったxhr
メッセージをが含まれていたので、削除しています。
actionpack/lib/action_dispatch/testing/integration.rb
の修正です。
ActionDispatch::IntegrationTest
のHTTP request methodsでキーワード引数を使用していない場合に出力されるwarningメッセージに、使用出来るキーワード引数の一覧を表示するよう修正しています。
Merge pull request #18918 from morgoth/do-not-overwrite-value-of-secret-token-when-present
activerecord/lib/active_record/secure_token.rb
の修正です。
既にtokenに値が設定されている場合に、has_secure_token
メソッドが既存の値を上書きしないよう修正しています。
user = User.create(token: "custom-secure-token") user.token # => "custom-secure-token"
remove CHANGELOG entry for Rails 5.0 only feature. #18918
activerecord/CHANGELOG.md
の修正です。
既にリリース済みのhas_secure_token
メソッドについてCHANGELOGに記載されていたのを、削除しています。
Correct module name in deprecation message.
ActionDispatch::IntegrationTest
のHTTP request methodsでキーワード引数を使用していない場合に出力されるwarningメッセージで出力されるモジュール名に誤りがあったのを修正しています。
Merge pull request #16381 from kakipo/validate-length-tokenizer
activemodel/lib/active_model/validations/length.rb
の修正です。
LengthValidator
のtokenize
オプションにメソッド名を指定出来るよう対応しています。
class Article include ActiveModel::Model validates_length_of :content, minimum: 10, message: "must be at least 10 words", tokenizer: :tokenize_by_words def tokenize_by_words(text) text.scan(/\w+/) end end