2017/03/04分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Add
ActiveSupport::TimeZone.iso8601
parsing method - Add
ActiveSupport::TimeZone.rfc3339
parsing method - Add
Time.rfc3339
parsing method - Add
rfc3339
aliases toxmlschema
- Don’t share options between reference id and type columns
- Fix
rake db:migrate:status
with subdirectories
Remove node
parameter to join_constraints
activerecord/lib/active_record/associations/join_dependency.rb
、
activerecord/lib/active_record/associations/join_dependency/join_association.rb
の修正です。
JoinAssociation#join_constraints
メソッドから使用されていないnode
引数を削除しています。
Move join scopes on to the reflection object
activerecord/lib/active_record/associations/join_dependency/join_association.rb
、
activerecord/lib/active_record/reflection.rb
の修正です。
JoinAssociation#join_constraints
メソッド内でおこなっていたscopeのjoin処理を、Reflectionクラス(AbstractReflection
、PolymorphicReflection
等)にjoin処理用のメソッド(#join_scopes
)を追加し、そちらで処理を行うよう修正しています。
ask reflection for klass join reflection
activerecord/lib/active_record/associations/join_dependency/join_association.rb
、
activerecord/lib/active_record/reflection.rb
の修正です。
JoinAssociation#join_constraints
メソッド内でおこなっていたklass scopeのjoin処理を、Reflectionクラスjoin処理用のメソッド(#klass_join_scope
)を追加し、そちらで処理を行うよう修正しています。
Remove unnecessary system test code
railties/lib/rails/test_help.rb
の修正です。
不要なaction_dispatch/system_test_case
のrequire、及び、ActionDispatch::SystemTestCase
のbefore_setup
メソッドを削除しています。
実際にActionDispatch::SystemTestCase
を使用される際にクラスはautoloadされる、かつ、before_setup
はActionDispatch::SystemTestCase
の親クラスであるActionDispatch::IntegrationTest
で同じ内容を定義済みであり、SystemTestCase
に別途定義する必要は無いため、削除したとの事です。
rails guideのActive Model Basics
の修正です。
includes
をinclude
にタイポしている箇所があったのを修正しています。
Add ActiveSupport::TimeZone.iso8601
parsing method
activesupport/lib/active_support/values/time_zone.rb
の修正です。
ISO 8601形式の文字列をパースする為のiso8601
メソッドをActiveSupport::TimeZone
に追加しています。
Time.zone = "Hawaii" Time.zone.iso8601("1999-12-31T14:00:00Z") # => Fri, 31 Dec 1999 04:00:00 HST -10:00 Time.zone.iso8601("1999-12-31") # => Fri, 31 Dec 1999 00:00:00 HST -10:00
Add ActiveSupport::TimeZone.rfc3339
parsing method
activesupport/lib/active_support/values/time_zone.rb
の修正です。
RFC 3339形式の文字列をパースする為のrfc3339
メソッドをActiveSupport::TimeZone
に追加しています。
Time.zone = "Hawaii" Time.zone.rfc3339("1999-12-31T14:00:00Z") # => Fri, 31 Dec 1999 04:00:00 HST -10:00
Add Time.rfc3339
parsing method
activesupport/lib/active_support/core_ext/time/calculations.rb
の修正です。
RFC 3339形式の文字列をパースする為のrfc3339
メソッドをこちらはTime
クラスに追加しています。
Time.rfc3339('1999-12-31T14:00:00-10:00') # => 1999-12-31 14:00:00 -1000
戻り値は当然Time
クラスのインスタンスです。
Add rfc3339
aliases to xmlschema
activesupport/lib/active_support/core_ext/time/conversions.rb
、
activesupport/lib/active_support/time_with_zone.rb
の修正です。
先に追加されたActiveSupport::TimeZone
、及びTime
のrfc3339
メソッドのaliasとして、xmlschema
メソッドを追加しています。
refactor so there is only one JoinKeys factory method
activerecord/lib/active_record/reflection.rb
の修正です。
JoinKeys
クラスを生成する為のfactoryメソッドが子クラス(BelongsToReflection
)で別途定義されてしまっていたのを、親で定義されているfactoryメソッドを使えるようリファクタリングしています。
join_keys
no longer needs a class passed to it
Active Recordの修正です。
Reflectionのjoin_keys
メソッドにassociation classを渡していたのを、渡さないで済むようリファクタリングしています。join_keys
メソッドでJoinKeys
を生成する際は、それぞれのclassで保持している情報をしか使用しておらず、そもそも渡す必要は無かった為、余計な依存関係を無くすようにする為に、削除したようです。
activerecord/lib/active_record/associations/association_scope.rb
の修正です。
last_chain_scope
、next_chain_scope
、add_constraints
各メソッドから使用されていないassociation_klass
引数を削除しています。
Merge pull request #28265 from 0oneo/association_guide
rails guideのActive Record Associations
の修正です。
The has_one Association
の項にあるmigrationでunique
オプションの指定の仕方に誤りがあったのを修正しています。
A private method can’t be called with self.
railties/lib/rails/generators/erb.rb
の修正です。
filename_with_extensions
メソッドでデフォルト引数を指定する際に、privateメソッドをself.
付きで呼ぼうとしてエラーになっていた為、self.
を削除しています。
Escapes and edits to configuring guide [ci skip] (#28280)
rails guideのConfiguring Rails Applications
の修正です。
各項目のフォーマット、グラマーの修正をまとめて行っています。
Don’t share options
with a reference type column
activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
の修正です。
polymorphic reference columnをmigrationで作成する際に、指定されたオプションをid column、type columnに両方に適応したのを、id columnにだけ適応するよう修正しています。
add_reference :posts, :taggable, type: :integer, limit: 2, polymorphic: true
上記のような migrationでpolymorphic columを作成した場合い、limit: 2
オプションをがtaggable_type
にも適応されていました。しかし、idとtypeは型が違い、オプションをそのまま適応するのは予想外の振る舞いになる事が多い為、typeにはオプションを適応しないよう修正したようです。
Silence puma startup messages in system test
actionpack/lib/action_dispatch/system_testing/server.rb
の修正です。
system testでpumaを起動する際に、pumaのスタートアップメッセージをstdoutに表示しないよう修正しています。
Fx system test example [ci skip]
rails guideのA Guide to Testing Rails Applications
の修正です。
system_test
をgenerateするexampleで、system test nameに不要なtest
があったのを削除、及び、生成されるファイルのexampleが実際生成されるファイルと異なっていたのを修正しています。
[ci skip] Add CHANGELOG entry for #28282
activerecord/CHANGELOG.md
の修正です。
先の polymorphic reference columnの対応について、CHANGELOGにエントリーを追加しています。
Fix rake db:migrate:status
with subdirectories
activerecord/lib/active_record/migration.rb
、
activerecord/lib/active_record/railties/databases.rake
の修正です。
db:migrate:status
タスクが、サブディレクトリにmigrationファイルがある場合にMigration Nameを正しく表示出来ないバグがあったのを修正しています。
Add a changelog entry for #28284 [ci skip]
actionpack/CHANGELOG.md
の修正です。
system testでpumaを起動する際にpumaのスタートアップメッセージをstdoutに表示しないよう修正した対応について、CHANGELOGにエントリーを追加しています。
Fix a wrong pull request reference [ci skip]
actionpack/CHANGELOG.md
の修正です。
先のエントリーを追加した際に、参照するPRのIDに誤りがあったのを修正しています。