なるようになるブログ

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

rails commit log流し読み(2016/07/21)

2016/07/21分のコミットです。

CHANGELOGへの追加はありませんでした。


Remove tab chars before commands to be run

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

PendingMigrationErrorNoEnvironmentInSchemaErrorのエラーメッセージに含まれている実行用コマンドのメッセージからタブを削除しています。

-      msg = "Environment data not found in the schema. To resolve this issue, run: \n\n\tbin/rails db:environment:set"
+      msg = "Environment data not found in the schema. To resolve this issue, run: \n\n        bin/rails db:environment:set"

タブが含まれていると、そのままコピペでの実行が正しく出来ない環境がある為、との事。


Bring back support for callable cache_key on collection rendering

actionview/lib/action_view/helpers/cache_helper.rbactionview/lib/action_view/renderer/partial_renderer/collection_caching.rbの修正です。

collection cacheのcache keyにblockを指定出来るよう修正しています。

<%= render partial: 'projects/project', collection: @projects, cached: -> project { [ project, current_user ] } %>

Enforce minimal web-console version for Rails 5

railties/lib/rails/generators/rails/app/templates/Gemfileの修正です。

新規Railsアプリ用のGemfileのweb-consoleを指定している箇所に、バージョン指定を追加しています。

-  gem 'web-console'
+  gem 'web-console', '>= 3.3.0'

古いweb-consoleだとRails 5.0.0では動かないので、正常に動くバージョンが使用されるようバージョン指定を追加したとの事です。


explain the meaning of some RuboCop config options [ci skip]

.rubocop.ymlの修正です。

rubocopの各オプションに何の為のオプションか説明を追加しています。


Fix incorrect indentation in method comment [ci skip]

actionpack/lib/action_controller/metal/request_forgery_protection.rbのdocの修正です。

protect_from_forgeryメソッドのdoc内でインデントがずれてしまい、rdocの表示がおかしくなってしまっている箇所があったのを修正しています。