なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2016/04/18)

2016/04/18分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

activerecord/CHANGELOG.md

activesupport/CHANGELOG.md


Properly verify that cache accepts and user expires value.

actionpack/test/controller/caching_test.rbの修正です。

fragment cacheにexpires_inオプションを指定した場合に、正常にexpireされる事を確認するテストを追加しています。


Specify that behavior will be deprecated in Rails 5.1

activesupport/lib/active_support/callbacks.rbの修正です。

callback chainを停止させるのにfalseを使用した場合に出力されるwarning messageで、Railsの次のバージョンではfalseでは停止出来なくなる旨メッセージを表示していたのを、Rails 5.1では停止できなくなる、という風に、明確にバージョンを指定するよう修正しています。


Added notice when a database is successfully created or dropped.

activerecord/lib/active_record/tasks/database_tasks.rbの修正です。

db:createdb:drop、それぞれのタスクで正常に処理が終わった際に、メッセージを表示するよう修正しています。

$ bin/rails db:create
Created database 'blog_development'
Created database 'blog_test'

$ bin/rails db:drop
Dropped database 'blog_development'
Dropped database 'blog_test'

Move CHANGELOG entry about database notices at the top [ci skip]

activerecord/CHANGELOG.mdの修正です。

先のdb:createdb:drop、それぞれのタスクで正常に処理が終わった際にメッセージを表示するよう修正した対応のentryを、CHANGELOGの先頭に移動しています。


Add note about ability to add database comments to release notes [ci skip]

rails guideのRuby on Rails 5.0 Release Notesの修正です。

先のdb:createdb:drop、それぞれのタスクで正常に処理が終わった際にメッセージを表示するよう修正した対応のentryを、Notable changesの項に記載しています。


Fix wording related to adapters supporting database comments [ci skip]

rails guideのActive Record Migrationsの修正です。

Writing a Migrationの項のタイポの修正を行っています。


Merge pull request #22806 from Envek/solid_durations

Active Supportの修正です。

ActiveSupport::Durationでweeksとhoursを使用出来るよう修正しています。

CHANGELOGより。

[1.hour.inspect, 1.hour.value, 1.hour.parts]
# => ["3600 seconds", 3600, [[:seconds, 3600]]]   # Before
# => ["1 hour", 3600, [[:hours, 1]]]              # After

[1.week.inspect, 1.week.value, 1.week.parts]
# => ["7 days", 604800, [[:days, 7]]]             # Before
# => ["1 week", 604800, [[:weeks, 1]]]            # After

よりISO8601のフォーマットに準拠にする為、との事です。なお、コンパチ用にvalueは変更前と同じ値が戻るようになっています。


Merge pull request #24581 from vipulnsward/add-reference-named-unique-index-test

activerecord/test/cases/migration/references_statements_test.rbの修正です。

add_referenceメソッドindexオプションを指定、かつindexオプションにnameオプションを指定した場合に、nameに指定した値でindexが作成されている事を確認するテストを追加しています。


Merge pull request #24587 from mechanicles/doc-consistency

activesupport/lib/active_support/cache.rbのdocの修正です。

メソッドのdocのグラマーの修正を行っています。


[ci skip] Update ActiveRecord associations documentation to avoid confusion with :validate option. Caused by #24532.

activerecord/lib/active_record/associations.rbのdocの修正です。

ActiveRecord::Assocation moduleのdocに、各associationメソッドvalidateオプションにtrueを指定した場合の挙動についての説明を追加しています。


removes unneeded require in rails/railtie.rb

railties/lib/rails/railtie.rbの修正です。

不要なrails/configurationのrequireを削除しています。


Merge pull request #24600 from tomkadwill/action-cabel-channel-typos

Action Cableのdocの修正です。

各doc内のタイポをまとめて修正しています。


Fix forced cache miss for fetch.

activesupport/lib/active_support/cache.rbの修正です。

#fetchメソッドforce: trueオプションを指定した場合、かつ、blockが指定されなかった場合に、ArgumentErrorをraiseするよう修正しています。

# before
cache.fetch('today', force: true) #=> nil

# after
cache.fetch('today', force: true) # => ArgumentError: Missing block

引数が足りてない事を明確に伝える為、ですかねえ。