2016/04/24分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Add
Time#sec_fraction
to return the fraction of a second as aRational
. - Add additional aliases for
DateTime#utc
to mirror the ones onActiveSupport::TimeWithZone
andTime
. - Add
DateTime#subsec
to return the fraction of a second as aRational
. - Make
getlocal
andgetutc
always return instances ofTime
forActiveSupport::TimeWithZone
andDateTime
.
activesupport/lib/active_support/core_ext/time/calculations.rb
の修正です。
秒の分数をRational
で返すTime#sec_fraction
メソッドを追加しています。
Time.new(2012, 8, 29, 0, 0, 0.5).sec_fraction # => (1/2)
Add CHANGELOG entry for #24700
activesupport/CHANGELOG.md
の修正です。
DateTime#localtime
、DateTime#getlocal
メソッドを追加した対応について、CHANGELOGにentryを追加してます。
Add additional aliases for DateTime#utc
activesupport/lib/active_support/core_ext/date_time/calculations.rb
の修正です。
DateTime#utc
のaliasとして、#getgm
、#gmtime
メソッドを追加しています。
Change Time#sec_fraction to use subsec
activesupport/lib/active_support/core_ext/time/calculations.rb
の修正です。
Time#sec_fraction
メソッドで、subsec
メソッドを使用するよう修正しています。
def sec_fraction - Rational(nsec, 1000000000) + subsec end
activesupport/lib/active_support/core_ext/date_time/calculations.rb
の修正です。
秒の分数をRational
で返すDateTime#subsec
メソッドを追加しています。
DateTime.new(2012, 8, 29, 0, 0, 0.5).subsec # => (1/2)
内部的には、#sec_fraction
メソッドを呼び出しているだけです。
def subsec sec_fraction end
Make getlocal and getutc always return instances of Time
Active Supportの修正です。
ActiveSupport::TimeWithZone、
DateTimeの
getlocal、
getutcメソッドが、必ず
Time`クラスのインスタンスを返すよう修正しています。
ActiveSupport::TimeWithZone
がDateTime
のインスタンスをラップしている時に、to_time
メソッドの呼び出しがstack level too deep errorになってしまうバグがあり、その修正の為に対応を行ったようです。
Follow up of https://github.com/rails/rails/commit/c9c5788a527b70d7f983e2b4b47e3afd863d9f48
activesupport/CHANGELOG.md
、
activesupport/lib/active_support/core_ext/date_and_time/compatibility.rb
のdocの修正です。
CHANGELOGのActiveSupport.to_time_preserves_timezone
についてのentry、及びpreserve_timezone
accessorについてのdocについて、グラマーの修正を行っています。
Share lock: avoid livelock due to exclusive thread sleeping before waiting threads wake
activesupport/lib/active_support/concurrency/share_lock.rb
の修正です。
排他スレッドの処理終了を待つ前に、#broadcast
を使用してスレッドを再開するよう修正しています。
yield_shares(compatible: compatible, block_share: true) do
+ @cv.broadcast
@cv.wait_while { @exclusive_thread || eligible_waiters?(compatible) }
activerecord/lib/active_record/locking/optimistic.rb
の修正です。
Active Recordの楽観的排他制御用処理で、lock_version
カラムにnil
を指定した場合に、エラーになってしまっていたのを修正しています。
Fix typo in ActiveJob #retry_job doc
activejob/lib/active_job/enqueuing.rb
のdocの修正です。
retry_job
メソッドのdoc内のexampleコードで、Scraper
をScrapper
にタイポしている箇所があったのを修正しています。
Deprecate request_via_redirect
method.
actionpack/lib/action_dispatch/testing/integration.rb
の修正です。
request_via_redirect
メソッドを使用した際に、deprecate
メッセージを表示するよう修正しています。
他のxxx_via_redirect
メソッド(get_via_redirect
、post_via_redirect
等)はDeprecate *_via_redirect integration test methods by aditya-kapoor · Pull Request #18693 · rails/railsで、使用した際にdeprecateメッセージを表示するようになっていたのですが、request_via_redirect
については対応が漏れてしまっていたので、追加で対応を行っています。
Add :nodoc:
to insert_versions_sql
[ci skip]
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
、
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
の修正です。
private APIであるinsert_versions_sql
に:nodoc:
を設定しています。
Remove in the doc about MySQL versions below 5 [ci skip]
activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
のdocの修正です。
transaction
メソッドのdocにMySQL 5未満の場合の注意事項が記載されていたのですが、Rails 5ではMySQL 5.0以上のみをサポートするようになり、MySQL 5.0未満はサポート対象外になった為、該当の注意事項を削除しています。
Move require 'ipaddr'
in postgresql/oid/cidr.rb
activerecord/lib/active_record/connection_adapters/postgresql/oid/cidr.rb
、
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
の修正です。
ipaddr
のrequire
をactiverecord/lib/active_record/connection_adapters/postgresql/oid/cidr.rb
で行うよう修正しています。
ipaddr
を実際に使用しているのはActiveRecord::ConnectionAdapters::PostgreSQL::OID::Cidr
クラスの為。
Move select_rows
implementation to super class
activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
、
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
の修正です。
SQLite3Adapter
クラスで定義していたselect_rows
メソッドの実装を親クラスに移動しています。
add channels files in stats
task
railties/lib/rails/tasks/statistics.rake
の修正です。
stats
taskで、channels
ディレクトリのファイルも表示されるよう修正しています。
Merge pull request #23461 from kamipo/prepared_statements_for_mysql2_adapter
Active Recordの修正です。
Mysql2Adapter
でPrepared statementを使用出来るように対応しています。
デフォルトでは無効になっており、config/database.yml
にprepared_statements: true
を設定する事で使用出来るようになりますた。また、mysql2
gem 0.4.4以上が必要となっています。
Fix broken build, channel files are also included in bin/rails stats
now
railties/test/application/rake_test.rb
の修正です。
先のstats
taskでchannels
ディレクトリのファイルも表示されるよう修正した対応で、テストの修正が漏れていたので、対応しています。
rails guideのRuby on Rails 5.0 Release Notes
の修正です。
Mysql2Adapter
でPrepared statementを使用出来るようにした対応について、Notable changes
の項にentryを追加しています。