2016/03/25分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Fix a tip in Active Record time attributes deprecation https://github.com/rails/rails/commit/05244fa7d79fb84a1a6e3f6948ad389157fb64e1
activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
の修正です。
Rails 5.0でtime型のカラムを使用した場合、Rails 5.1からはtime型もtime zoneの影響を受ける旨deprecateメッセージが表示され、その中にRails 5.0でもその挙動にしたい場合の対応が表示されるのですが、 その内容に誤りがあった(表示される内容の通りに設定を行うとエラーになる)のを、修正しています。
- config.active_record.time_zone_aware_types << :time + config.active_record.time_zone_aware_types = [:datetime, :time]
Make 'migrate' clear the schema cache afterward
activerecord/lib/active_record/tasks/database_tasks.rb
の修正です。
db:migrate
task完了時に、schema cacheをclearするよう修正しています。
Cable: fix Faye periodic timer shutdown typo
actioncable/lib/action_cable/connection/faye_event_loop.rb
の修正です。
ActionCable::Connection::FayeEventLoop::EMTimer#shutdown
メソッドで、参照する変数名をタイポしていたのを修正しています。
Move sequence value methods to Model level
activerecord/lib/active_record/model_schema.rb
の修正です。
sequence valueに関する処理をメソッド(prefetch_primary_key?
、`next_sequence_value)に切り出しています。
それぞれconnectionから値を取得する処理なのですが、DBではなく別のサービスからIDを取得したい、というような場合の為に、メソッドを切り出し、動作を子クラスで変えれるようにしています。
Memoize user provided defaults before type casting
activerecord/lib/active_record/attribute/user_provided_default.rb
の修正です。
Active Record attributes APIを使用している、かつ、defaultにprocを使用した場合に、form builderでそのattributeを表示した際に値が正しく表示されない(Proc#to_s
した値が表示されていた)バグがあったのを修正しています。
procを毎回実行して値を表示するのではなく、type cast処理の前にprocを実行し、その値を保持するよう対応しています。
Apply scale before precision when coercing floats to decimal
activemodel/lib/active_model/type/decimal.rb
の修正です。
floatをBigDecimalに変換する際、scaleの値に合わせてround処理を行うよう修正しています。
scaleの値を先に合わせてround処理を行っておかないと、最終的に丸められた値がずれてしまう為、との事です。
# before ActiveModel::Type::Decimal.new(precision: 5, scale: 3).cast(1.250473853637869).to_s # => "1.251" # after ActiveModel::Type::Decimal.new(precision: 5, scale: 3).cast(1.250473853637869).to_s # => "1.25"
Revert "Ensure config.active_record.time_zone_aware_types
is always set"
config.active_record.time_zone_aware_types
が必ず設定されるよう修正した、Ensure config.active_record.time_zone_aware_types
is always setをrevertしています。
time_zone_aware_types
が設定されるよう修正したつもりだったのですが、実際は出来てなかった(参照しているオブジェクトが誤っていた)為、revertしたとの事です。
Fix typo in Action Pack changelog [ci skip]
actionpack/CHANGELOG.md
の修正です。
submitting
をsubmiting
にタイポしている箇所があったのを修正しています。
set in no more used in ActionView::Template::Types
actionview/lib/action_view/template/types.rb
の修正です。
使用していないset
のrequireを削除しています。
Merge pull request #24299 from kitop/activemodel-errors-include-fix
activemodel/lib/active_model/errors.rb
の修正です。
ActiveModel::Errors#include?
メソッドに@messages
hashに存在しないkeyを指定した場合に、指定したkeyが@messages
hashに追加されてしまう、というバグ(?)があったのを修正しています。
def include?(attribute) - messages[attribute].present? + messages.key?(attribute) && messages[attribute].present? end
Correct typos in "Active Record Query Interface" guide
rails guideのActive Record Query Interface
の修正です。
コードスニペットのコメント部分に#
が足りてない部分があったのを追加しています。