2015/01/06分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Add #on_weekend?, #next_weekday, and #prev_weekday methods to Date, Time, and DateTime
- Add same_time option to #prev_week and #next_week for Date, Time, and DateTime
- Add #prev_day and #next_day as counterparts to #yesterday and #tomorrow for Date, Time, and DateTime
Fix TypeError in Fixture creation
activerecord/lib/active_record/fixtures.rb
の修正です。
fixtureファイルで$LABEL
を使用した際、LABELがString以外(Integer等)だった場合にエラーになっていたのを修正しています。
Add firebird support to test suite
ActiveRecordのテストの修正です。
adapterがFirebirdの場合にテストが実行されるよう修正しています。 Firebird、使われてるんですかねえ。
Merge pull request #17676 from tigrish/fix_custom_i18n_exception_handler_regression
actionview/lib/action_view/helpers/translation_helper.rb
の修正です。
translate
メソッドで、指定されたkeyが存在しない場合に、エラーをraiseする条件に誤りがあったのを修正しています。
raise
オプションがfalse、又はオプションにrescue_format
の指定があって、その値がnilの場合は、エラーをraiseしない、が正しい挙動のようです。
Avoid changing the global state on the tests
actionview/test/template/translation_helper_test.rb
の修正です。
setup
処理でI18n.exception_handler
の値を変更していたのを、テストの中で値を変更し、テストのensure
処理で元の値に戻すよう修正しています。
Fix rollback of primarykey-less tables
activerecord/lib/active_record/transactions.rb
の修正です。
primary keyが無いtableに対するrollback処理を行った時、ActiveModel::MissingAttributeError: can't write unknown attribute
が起きてしまっていたバグがあったのを修正しています。
activerecord/test/cases/transactions_test.rb
の修正です。不要な空行を削除しています。
Define attribute methods before attempting to populate records
activerecord/lib/active_record/core.rb
の修正です。
define_attribute_methods
をinit_internals
、initialize_internals_callback
メソッドの呼び出し前に定義するよう修正しています。
initialize_internals_callback
でattributesの操作処理を行うケースがあり、その場合にエラーになってしまっていた為、定義位置を修正したようです。
Correctly fetch bind_values from join in subquery
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
bind_values
の設定処理をbuild_from
メソッドで行っていたのをfrom!
メソッドで行うよう修正しています。
from
メソッド内のサブクエリーでjoin
をしていた場合に、エラーになってしまっていた為対応しています。
Improve protect_from_forgery documentation. [ci skip].
actionpack/lib/action_controller/metal/request_forgery_protection.rb
のdocの修正です。
protect_from_forgery
メソッドについての説明を修正しています。
adding documentation for 'remove_possible_method' and 'redefine_method' [ci skip]
activesupport/lib/active_support/core_ext/module/remove_method.rb
の修正です。
remove_possible_method
、redefine_method
メソッドのdocを削除しています。
これは何でだろう。:nodoc:
を追加している訳でも無いんですよねえ。
removing unecessary parameter in private method
activemodel/lib/active_model/naming.rb
の修正です。
_singularize
メソッドから不要な引数を削除しています。
Add #on_weekend?, #next_weekday, and #prev_weekday methods to Date, Time, and DateTime
activesupport/lib/active_support/core_ext/date_and_time/calculations.rb
の修正です。
Date
、Time
、DateTime
に#on_weekend?
、#next_weekday
、#prev_weekday
メソッドを追加しています。
on_weekend?
メソッドは土曜か日曜の場合にtrueを、それ以外の曜日の場合はfalseを返します。
next_weekday
は次の平日を返します。なので、月〜木の場合は、単純に翌日を、金曜の場合は次の曜日のdate/timeオブジェクトを返します。prev_weekday
はその逆ですね。
Add same_time option to #prev_week and #next_week for Date, Time, and DateTime
activesupport/lib/active_support/core_ext/date_and_time/calculations.rb
の修正です。
prev_week
、next_week
メソッドにsame_time
オプションを追加しています。
Time.now.next_week => 2015-01-12 00:00:00 +0900 Time.now.next_week(same_time: true) # => 2015-01-12 06:45:47 +0900
現在時刻を保持する為のオプションなんですねえ。
Add #prev_day and #next_day as counterparts to #yesterday and #tomorrow for Date, Time, and DateTime
activesupport/lib/active_support/core_ext/date_and_time/calculations.rb
の修正です。
Date
、Time
、DateTime
にprev_day
、next_day
メソッドを追加しています。
翌日/前日のdate/timeのインスタンスを返します。 tomorrow
/ yesterday
と一緒です。
Fix lookup of fixtures with non-string label
activerecord/test/cases/fixtures_test.rb
先に行われたfixtureファイルLABEL
にString以外の値を使用した際の対応について、テストを追加しています。
replacing 'attribute' method with an alias
activerecord/lib/active_record/attribute_methods/read.rb
の修正です。
attribute
メソッドを_read_attribute
メソッドのエイリアスに修正しています。
Fixed typos and wording in ActiveRecord CHANGELOG [ci skip]
activerecord/CHANGELOG.md
の修正です。タイポの修正を行っています。
Add log_level options to configuration guide
rails guideのConfiguring Rails Applications
の修正です。
config.log_level
の説明をしている箇所に、設定可能なログレベルについての説明を追加しています。