なるようになるブログ

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

rails commit log流し読み(2014/05/02)

2014/05/02分のコミットです。

DBにSQLite3を使用している際に、connectionがcloseされない場合があるバグの修正が行われています。


Avoid unnecessary conditional block

railties/lib/rails/generators/erb/scaffold/templates/_form.html.erbの修正です。scaffoldで生成されるtemplateですね。

attribute.reference?のチェック処理があるのですが、この処理以前に既にチェック済みらしく、ここでのチェック処理は不要なので削除しています。


Merge pull request #13640 from maginatics/fix_sqlite3_ensure_master

sqlite3_adapterの修正です。connectionのクローズがされない場合があるバグを修正しています。

begin..ensureを追加して、ensureでcloseメソッドを呼び出すよう修正しています。


Remove unused variable

activerecord/test/cases/associations/callbacks_test.rbの修正です。不要な変数の削除。


Merge pull request #12651 from cespare/ipv6-remote-ip-fixes actionpack/lib/action_dispatch/middleware/remote_ip.rbの修正です。

TRUSTED_PROXIESIPv6のユニークローカルユニキャストアドレス(fc00::/7)を追加しています。


[ci skip] Security guide clarity.

rails guideの修正です。securityページの文法の修正です。


always use File.join

ActionView::Helpers::AssetUrlHelper#asset_pathメソッドの修正です。

ファイルパスを生成する際、Stringでパスを生成していたのを、File.joinを使うように修正しています。これにより、 スラッシュが連続する、という事が無くなってます。

# before
https://some.host.com//assets/some.js

# after
https://some.host.com/assets/some.js

never merge url options in to the first data hash

ActionDispatch::Routing::PolymorphicRoutes#polymorphic_urlメソッドの修正です。

- args.last.kind_of?(Hash) ? args.last.merge!(url_options) : args << url_options
+ args << url_options

argspolymorphic_urlメソッドの第一引数(少し加工していますが)で、マージしないようにした、というのは分かるのですが、 これが、何のための修正なのかは良く分からなかったです。


always pass options to the _url method

同じくpolymorphic_urlメソッドの修正です。

-        unless url_options.empty?
-          args << url_options
-        end
+        args << url_options

修正これだけなのですが、この修正が何のために行われたのかが、こちらも分からず…。


only add the optiosn if they are not empty

同じくpolymorphic_urlメソッドの修正です。

-        args << url_options
+        unless url_options.empty?
+          args << url_options
+        end

上のコミットで外したチェック処理を戻しています。


Form_tag_helper grammar fix [skip ci]

actionview/lib/action_view/helpers/form_tag_helper.rbのdocの修正です。文法の修正だけです。


Enhance a bit a few changelog entries [ci skip]

CHANGELOGの修正です。改行入れたり、スペース入れたり、ピリオド入れたり等の、細かい修正です。


Follow up to 38ad5438 [ci skip]

rails guideのcontributing_to_ruby_on_railsのページの修正です。

このコミットでtitleの横に不要な###が追加されていたので、それの削除、改行の追加、Running a Single Testの項を追加しています。


[ci skip] Update guides license to CC BY-SA 4.0 International.

rails guideのライセンスページの修正です。ライセンスを CC BY-SA 3.0からCC BY-SA 4.0に変更してます。


Added link for 4.1 guides on edge guide [ci skip]

rails guideのwelcomeページの修正です。

rails 4.1のguideページへのリンクを追加しています。


Tiny follow up to #14915 [ci skip]

昨日あった、ActionDispatch::Mapping::Base#rootメソッドのdocの修正の追加です。

via: [:get]via: :getに修正しています。


Automaticly add username and email if configured in git-scm, as bundle gem

railties/lib/rails/generators/rails/plugin/plugin_generator.rb

plugin生成の際に、.gemspecに記載するauthorsemailをgitの値を取得し設定するようにしています。

gitの値はgit configコマンドを直接実行して取得しています。

このやり方ちょっと便利ですね。


Works correctly if git not installed

上のコミットの追加修正です。

git configの値の取得の際に、gitがインストールされてない場合の処理(rescue)を入れてます。


skip-git should not hit git commands plugin generators

上のコミットの追加修正です。plugin generatorに--skip-gitオプションを追加しています。

--skip-gitオプションが設定されていた場合、authors/emailにgitの値の設定は行いません。