2017/11/10分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
actionview/CHANGELOG.md
Fix field_error_proc wrap form select optgroup and divider option tag
actionview/lib/action_view/helpers/active_model_helper.rb
の修正です。
formでエラーが発生した際に、field_error_proc
がoptgroup
タグやseletct
タグ内のoption
タグもfield_with_errors
クラスでラップしていたのを、ラップしないよう修正しています。
<select name="post[category]" id="post_category">
<option value="">Please select</option>
<div class="field_with_errors">
<optgroup label="A">
<option value="A1">A1</option>
<option value="A2">A2</option>
</optgroup>
</div>
</select>
<select id="post_time_zone" name="post[time_zone]">
<option value=""></option>
<option value="Hawaii">(GMT-10:00) Hawaii</option>
<div class="field_with_errors">
<option value="" disabled="disabled">-------------</option>
</div>
</select>
元々は上記のようはhtmlが生成されていたのですが、select
タグの中にdiv
を書くのはhtmlの規約的にNGなので、上記ケースではfield_with_errors
を生成しないようにしています。
Merge pull request #31099 from nobu/patch-1
actionpack/test/controller/log_subscriber_test.rb
の修正です。
cache用のtmpディレクトリを作成するのにDir::Tmpname.make_tmpname
を使用していたのを、Dir.mktmpdir
を使用するよう修正しています。
Dir::Tmpname.make_tmpname
は内部用メソッドで、一意性は保証されておらず使用すべきでは無いため、とのことです。
Move Attribute and AttributeSet to ActiveModel
Active Modelの修正です。
Active Record配下にあったAttribute
クラス及びAttributeSet
クラスをActive Modelに移動しています。
Active Record内にあるattributes APIをActive Modelに移動する対応の一環。
Merge pull request #25346 from bogdan/correct-tags-count-in-fixtures
Active Recordのテストの修正です。
fixturesにcounter cacheの値が正しく指定されていなかったのを修正しています。
Merge pull request #30414 from bogdanvlviv/clear-mysql_database_tasks
Active Recordの修正です。
MySQL用のdatabase作成処理で、Access denied エラーがおきたときに、rootアカウントで再度処理を行う、という処理があったのをまとめて削除しています。
その処理の影響でAccess denied以外のエラーがおきた時にエラーメッセージが見づらくなってしまっていた為と、そもそも余計な事をせずエラーメッセージをそのまま表示した方が良いのでは、という事で削除されたようです。
Merge pull request #31027 from PHedkvist/inflector_test_type
activesupport/test/core_ext/string_ext_test.rb
、
activesupport/test/inflector_test_cases.rb
の修正です。
parameterizeのテストでPreserve
をPreserce
にタイポしていたのを修正しています。
Bump RuboCop to 0.51.0
RuboCopのバージョンを0.51.0に更新、及び、copに違反している箇所があったのをまとめて修正しています。
Use -e
option to specify the environment in console command [ci skip]
rails guideのThe Rails Command Line
、Configuring Rails Applications
の修正です。
rails console
コマンドにenvを指定する際に、-e
オプションを指定するよう修正しています。
-e
オプションを使用しないenvの指定は、Deprecate environment as an argument for dbconsole and consoleでdeprecateになった為。
Add missing requires
activemodel/lib/active_model/attribute.rb
、
activemodel/test/cases/attribute_set_test.rb
の修正です。
不足していたrequireを追加しています。
Remove unused require
activesupport/lib/active_support/test_case.rb
の修正です。
不要なactive_support/core_ext/kernel/reporting
のrequireを削除しています。
Merge pull request #31114 from y-yagi/fix_ruby_warnings_in_active_model
activemodel/lib/active_model/attributes.rb
、
activemodel/lib/active_model/dirty.rb
の修正です。
Active ModelでRubyのwarnings("warning: instance variable @attributes not initialized"、及び、"warning: assigned but unused variable - name")が出ている箇所があったのを修正しています。
Use new RDoc URL of Ruby core [ci skip]
rails guideのAPI Documentation Guidelines
の修正です。
RDocのURLを正しいURLに修正しています。
-[RDoc](http://docs.seattlerb.org/rdoc/). To generate it, make sure you are
+[RDoc](https://ruby.github.io/rdoc/). To generate it, make sure you are
RDocはruby core配下で管理されてるので、ruby.github.ioが正しいURLなんですねえ。
Use new Rake URL of Ruby core [ci skip]
actionview/RUNNING_UNIT_TESTS.rdoc
の修正です。
RakeのURLを正しいURLに修正しています。
-Rake can be found at http://docs.seattlerb.org/rake/.
+Rake can be found at https://ruby.github.io/rake/.
こちらも同様にruby.github.io配下。
Remove useless preloader classes
Active Recordの修正です。
ActiveRecord::Associations::Preloader
配下の不要なクラス(重複していた実装があった or そもそも実装が無かった)をまとめて削除しています。
Add missing requires
activemodel/lib/active_model/attribute.rb
の修正です。
不足していたactive_model/type
のrequireを追加しています。
Merge pull request #31065 from bogdan/cleanup-cache-key
activesupport/lib/active_support/cache.rb
の修正です。
Cache::Store#expanded_key
メソッドとCache.expanded_key
メソッドの実装が重複していたので、Store#expanded_key
メソッドを削除しCache.expanded_key
の方を使い回すよう修正しています。
Adjust blank lines
railtiesの修正です。
rails new
で生成されるGemfile、gitignore、environmentsファイル内のコード間の空行の調整を行っています。
:scissors:
activesupport/CHANGELOG.md
の修正です。
不要なスペースを削除しています。
Ensure apply_join_dependency
for subqueries in from
and where
activerecord/lib/active_record/relation/predicate_builder/relation_handler.rb
、
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
PredicateBuilder::RelationHandler#call
メソッド、及び、QueryMethods#build_from
メソッドでeager loadを使用している場合に、apply_join_dependency
メソッドを呼び出すよう修正しています。
from
メソッド、及び、where
メソッド内でsubquery + eager loadを使用した場合に正しいSQLを生成出来るようにするため、のようです。
Consolidate duplicated to_ary
/to_a
definitions in Relation
and CollectionProxy
activerecord/lib/active_record/associations/collection_proxy.rb
、
activerecord/lib/active_record/relation.rb
の修正です。
Relation
とCollectionProxy
それぞれに定義されていた同じ値を返すto_ary
/ to_a
メソッドの定義をRelation
側にマージしています。
Fix random CI failure due to non-deterministic sorting order
activerecord/test/cases/relations_test.rb
の修正です。
test_finding_with_subquery_with_eager_loading_in_where
でassociationを取得する際に、idでsortするよう修正しています。
sortしないと結果が不定になり、seedによってはテストが失敗してしまう為。
Add missing require "active_support/core_ext/hash/indifferent_access"
activemodel/lib/active_model/attribute_mutation_tracker.rb
の修正です。
不足していたactive_support/core_ext/hash/indifferent_access
のrequireを追加しています。