なるようになるブログ

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

rails commit log流し読み(2015/09/17)

2015/09/17分のコミットです。

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

railties/CHANGELOG.md

activerecord/CHANGELOG.md


Clarify CSRF script purpose and protection. Note how to deal with your own script tags.

guides/source/security.mdguides/source/upgrading_ruby_on_rails.mdの修正です。

Improved explanation of the script tag CSRF behavior のフォローアップで、自身のサイトで<script>タグを使用した場合についての説明を追記しています。


Removed mocha from Active Record Part 2

ActiveRecordのテストの修正です。

モック処理にmochaを使用していたのを、Rails内部のテスト用のヘルパーメソッドを使用するよう修正しています。


Don't hardcode table name

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

SchemaDumper#ignored?メソッドで、schema migration用のテーブル名が、schema_migrations固定になっていたのを、ActiveRecord::Base.schema_migrations_table_nameを使用するよう修正しています。


s/Github/GitHub/

activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rbのdocの修正です。

GithubGitHubに修しています。タイポ。


Improved ActiveRecord Connection Pool docs [ci skip]

activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rbのdocの修正です。

disconnect!メソッドのdoc内にあったタイポをまとめて修正しています。


Fix displaying mailer previews on non local requests.

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

mailer previewは、他の設定に関わらず、ローカルアドレスからのリクエストでないと表示されなかったのですが、action_mailer.show_previewsにtrueが設定されている場合は、ローカルからのアクセス以外でもmailer previewが表示されるよう修正しています。


[ci skip] Remove useless "@api public/private"

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

メソッドのdocから、不要な@api publicアノテーションを削除しています。


Merge pull request #21581 from ronakjangir47/restrict_with_error

activerecord/lib/active_record/associations/has_many_association.rbactiverecord/lib/active_record/associations/has_one_association.rbの修正です。

restrict_with_errorのエラーメッセージを表示する際、I18nで指定された値で、クラス名が表示されるよう修正しています。

テストより。

I18n.backend.store_translations 'en', activerecord: {attributes: {restricted_with_error_firm: {companies: 'client companies'}}}
firm = RestrictedWithErrorFirm.create!(name: 'restrict')
firm.companies.create(name: 'child')
firm.destroy

"Cannot delete record because dependent client companies exist", firm.errors[:base].first

Merge pull request #21651 from shingo-nakanishi/fixed_docs

actionview/lib/action_view/helpers/form_helper.rbのdocの修正です。

buttonメソッドのexampleにタイポがあったのを修正しています。