- Ruby1.9.2-p326から2.2.3p173にアップ。Railsは3.2.17
- こんなwarningが出ていてテストもこけている
…/.rbenv/versions/2.2.3/gemsets/3.3.x_version_up/gems/activerecord-3.2.17/lib/active_record/associations/has_many_association.rb:53: warning: circular argument reference - reflection
…/.rbenv/versions/2.2.3/gemsets/3.3.x_version_up/gems/activerecord-3.2.17/lib/active_record/associations/has_many_association.rb:57: warning: circular argument reference - reflection
…/.rbenv/versions/2.2.3/gemsets/3.3.x_version_up/gems/activerecord-3.2.17/lib/active_record/associations/has_many_association.rb:61: warning: circular argument reference - reflection
…/.rbenv/versions/2.2.3/gemsets/3.3.x_version_up/gems/activerecord-3.2.17/lib/active_record/associations/has_many_association.rb:80: warning: circular argument reference - reflection
NoMethodError: undefined method `name' for nil:NilClass
- gemのコードを見てみるとreflection = reflectionでエラーになってるらしい
has_many_association.rb
53 def has_cached_counter?(reflection = reflection)
54 owner.attribute_present?(cached_counter_attribute_name(reflection))
55 end
- 以下のように書き換えると取り敢えずwarning出なくなりテストも通るようになる
has_many_association.rb
53 def has_cached_counter?(reflection = reflection())
54 owner.attribute_present?(cached_counter_attribute_name(reflection))
55 end
- rails3.2.22で修正されている。Railsは後程上げるので今回は取り敢えずこれでいいかな