なるようになるブログ

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

rails commit log流し読み(2014/08/27)

2014/08/27分のコミットです。

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

railties/CHANGELOG.md


Keep the first string we fetch

activesupport/test/caching_test.rbの修正です。

テストする際に値をフェッチしていたのを止めて、変数に代入した値でテストを行うよう修正しています。

-    assert_not_equal @cache.read('foo').object_id, @cache.read('foo').object_id
     value = @cache.read('foo')
+    assert_not_equal value.object_id, @cache.read('foo').object_id

処理の途中にGCが動いてしまった場合に、テストがコケてしまう可能性がある為との事です。


Merge pull request #16613 from splattael/master

.travis.ymlの修正です。

JRubyのテストを行う際、JRUBY_OPTSを設定するよう修正しています。

設定しているのは、JRUBY_OPTS='-J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-Djruby.compile.mode=OFF -J-Djruby.compile.invokedynamic=false -J-Xmx1024M'です。これで高速化になるとの事。詳細は、JRubyのWiki参考。


[ci skip] Updated documentation syntax of block parameter for rdoc

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

"block"を"+block+"に修正しています。


[ci skip] Updated documentation syntax of block parameter for rdoc

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

こちらも"block"を"+block+"に修正しています。


[ci skip] Updated include to reference record parameter for rdoc

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

こちらは"object"を"+record+"に修正。


Adjusted punctuation and grammar for Form Helpers guide [ci skip]

rails guideのForm Helpersの修正です。

カンマ追加したり、セミコロン追加したり等のグラマーの修正です。


Merge pull request #16708 from zzak/bcjordan-patch-1


[ci skip] Updated documentation syntax of other parameter for rdoc

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

"other"を"+other+"に修正しています。


[ci skip] Modify a web-console PR link

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

web-consoleについてのPRのリンク先が誤っていたのを修正しています。


Use less iterations for KeyGenerator in tests

actionpack/test/dispatch/cookies_test.rbの修正です。

ActiveSupport::KeyGenerator.newする際、iterationsの値を指定するよう修正しています。

これでcookieのテストの性能改善になるそうです。結果は以下の通り。

Ruby  |   After  |   Before
----- | --------:| --------:
MRI   |    5.03s |     9.28s
JRuby |   25.45s |  1648.23s

minor changelog formatting changes.

CHANGELOGの修正です。

ピリオドの追加、シングルクォーテーションの追加等をしています。


fix broken gem method with non-String arguments. Closes #16709.

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

gemメソッドにString以外のオプションを指定した場合にエラーになっていたのを対応しています。

テストから。

gem 'rb-fsevent', require: false
gem 'whenever', require: false

上記の場合require: falseでエラーになってしまっていたようです。


Fix spelling. [CI SKIP]

railties/CHANGELOG.mdの修正です。

"spawnig"を"spawning"に修正しています。


Correctly detect mutation on serialized columns mapping to binary

activerecord/lib/active_record/type/binary.rbactiverecord/lib/active_record/type/serialized.rbの修正です。

serializeされたbinaryカラムを使用している場合に、値を変更してないにも関わらず、changesメソッドが値を返してしまうバグがあったのを修正しています。

以下issueから。

ActiveRecord::Schema.define do
  create_table :posts do |t|
    t.binary :data
  end
end
class Post < ActiveRecord::Base
  serialize :data
end
Post.create! data: 'foo'
post = Post.first
post.changes
# => {"data"=>["foo", "foo"]}

上記の場合、最後のchangesの結果は本来空になるべきなのに、値が返ってきてしまっていたんですねえ。rails 4.2.0 beta1でのバグでした。


[ci skip] Update 4_2_release notes

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

グラマーの修正です。


[ci skip] Fix typo of collection_singular_ids= method.

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

collection_singular_ids=メソッドの使い方にtypoがあったのを修正しています。


[ci skip] Fix typo of collection= method.

collection=メソッドの使い方にtypoがあったのを修正しています。