2016/02/01分のコミットです。
CHANGELOGへの追加はありませんでした。
Wait for EventMachine to finish starting
actioncable/test/client_test.rb
の修正です。
テストの前処理で、EventMachineが起動するまでスレッドを待たせるよう修正しています。
Thread.new { EventMachine.run } unless EventMachine.reactor_running?
+ Thread.pass until EventMachine.reactor_running?
Merge pull request #23368 from y-yagi/remove_backward_compatibility_code_for_minitest_4
guides/bug_report_templates/generic_master.rb
の修正です。
汎用的に使うようのbug report templateに、Minitest 4系用の互換コードが(Minitest 5でクラス名がMiniTest::Unit::TestCase
からMinitest::Test
に変わった事に関する対応)残っていたのを、削除しています。
Merge pull request #23369 from maclover7/actioncable-assets-redux
Action Cableの修正です。
CoffeeScriptで書かれていたAction Cableのjsを、gem リリース時に一つのJSにコンパイルするよう修正しています。
Action Cableの実装はCoffeeScriptで書かれていた為、Action Cableのruntime dependencyにcoffee-rails
が必要だったのですが、それだとRailsを使用するユーザーにCoffeeScriptのインストールを強制する事になり、それは宜しく無いだろう、とう事で、リリース時にJSにコンパイルし、使用する際はCoffeeScriptは不要になるよう対応した、との事です。
Wrangle the asset build into something that sounds more general
Action Cableの修正です
各JSのパス、assetsをコンパイルした際の出力先をより適切な箇所に修正しています。
Drop the runtime dependency on coffee-rails
actioncable/actioncable.gemspec
の修正です。
先の対応によりCoffeeScriptは不要になった為、runtime dependencyからcoffee-rails
を削除しています。
Merge pull request #23169 from y-yagi/rake_proxy_in_engine
railtiesの修正です。
Rails Engine配下でもrake proxyが動作するよう対応しています。
これで、Rails Engineでもbin/rails
コマンド経由で、rake
タスクを実行出来るようになっています。
Update middleware docs regarding ActionDispatch::LoadInterlock [ci skip]
各Rails guideの修正です。
各guide内のmiddlewareについて説明している箇所から、デフォルトでは使用しなくなったRack::Lock
についての削除、及び代わりに使用するようになったActionDispatch::LoadInterlock
についての説明を追加しています。
actioncable/test/client_test.rb
の修正です。
使用していないclose!
メソッドを削除しています。
clarify the touch true option does not trigger after_save/update [ci skip]
activerecord/lib/active_record/associations.rb
のdocの修正です。
belongs_to
メソッドのtouch
オプションについてのdocに、touch
が実行される際はvalidationが実行されない事、及びafter_touch
、after_commit
、after_rollback
callbackが実行される旨説明を追加しています。
Merge pull request #23370 from maclover7/actioncable-main-travis-build
.travis.yml
の修正です。
Action Cableのテストをallow_failures
から削除しています。
Wait for EventMachine to finish startingの対応でテストが安定したようだから、ですかねえ。
Remove case macro
from calculate_constructable
activerecord/lib/active_record/reflection.rb
の修正です。
AssociationReflection#calculate_constructable
メソッドでbelongs_to
、has_one
それぞれのassociationの場合の実装をまとめて行っていたのを、各子クラス(HasOneReflection
、BelongsToReflection
)でメソッドをオーバーライドし、それぞれのクラスで処理を行うよう修正しています。
Gemfile.lock
の修正です。
Drop the runtime dependency on coffee-railsでGemfileからcoffee-rails
を削除したのですが、Gemfile.lock
の更新が漏れていたので、追加で対応しています。
Merge pull request #23360 from kamipo/oid_money_precision_is_unused
activerecord/lib/active_record/connection_adapters/postgresql/oid/money.rb
、
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
の修正です。
もう使用していないOID::Money.precision
attributeを削除しています。
activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
、
activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
の修正です。
composite primary keyのテストで、不要なwarningが出ないようsilence_warnings
で囲むよう修正しています。
Merge pull request #23374 from prathamesh-sonpatki/migration-compatiblity-tests
activerecord/test/cases/migration/compatibility_test.rb
の修正です。
古いmigrationファイルで、add_timestamps
メソッドが生成するcreated_at
/ updated_at
のデフォルトがnullで有ることを確認するテストを追加しています。
Merge pull request #23372 from kamipo/use_index_in_create_in_test_schema
activerecord/test/schema/mysql2_specific_schema.rb
、
activerecord/test/schema/schema.rb
の修正です。
indexの定義にadd_index
メソッドを使用していたのを、TableDefinition#index
メソッドを使用するよう修正しています。
- create_table :key_tests, force: true, :options => 'ENGINE=MyISAM' do |t| + create_table :key_tests, force: true, options: 'ENGINE=MyISAM' do |t| t.string :awesome t.string :pizza t.string :snacks + t.index :awesome, type: :fulltext, name: 'index_key_tests_on_awesome' + t.index :pizza, using: :btree, name: 'index_key_tests_on_pizza' + t.index :snacks, name: 'index_key_tests_on_snack' end - add_index :key_tests, :awesome, :type => :fulltext, :name => 'index_key_tests_on_awesome' - add_index :key_tests, :pizza, :using => :btree, :name => 'index_key_tests_on_pizza' - add_index :key_tests, :snacks, :name => 'index_key_tests_on_snack'
テストの起動を早める為、との事です。
Extract ExplainPrettyPrinter
to appropriate files
Active Recordの修正です。
各adapter毎に異なる箇所で定義されていたExplainPrettyPrinter
クラスを、adapter毎に別ファイルで(explain_pretty_printer.rb
)定義するよう修正しています。
Remove duplicated composite primary key tests
Active Recordの修正です。
重複していたcomposite primary keyのテストを削除しています。
Revert "Merge pull request #23366 from maclover7/add-configuation-ar-docs"
rails guideのActive Record Basics
にDBへの接続の仕方を記載したConnecting to the Database
節を追加した、Add configuration section to "Active Record Basics" guideをrevertしています。
guideにはRailsの基本的な使い方について書くべきだ、上記内容はそこから外れているのでは、という事でrevertされたようです。
Remove development dependencies from actioncable.gemspec
actioncable/actioncable.gemspec
の修正です。
development dependencyからcoffee-script
、pg
等を削除しています。
既に他のコンポーネントで使用しているgemであり、Action Cableで個別に定義する必要は無い為、削除したようです。
Merge pull request #23359 from kamipo/make_to_primary_key
activerecord/lib/active_record/internal_metadata.rb
、
activerecord/lib/active_record/schema_migration.rb
の修正です。
internal tablesを作成する際、key
カラムにindexを設定したのを止めて、代わりにprimary keyの設定を行うよう修正しています。
Avoid extra show variables
in migration
Active Recordの修正です。
MySQL adapterで、migratin実行の度にshow variables
が実行されてしまっていたのを、不要な場合は実行されないよう修正しています。
schema migratin tableの作成処理でchartsetを取得する為にshow variables
を実行しているのですが、既にschema migration tableが作成済みの場合もchartsetを取得しようとする処理になってしまっていたのが問題だったようです。tableが既にある場合はchartsetの取得処理は行わないよう修正しています。
Added references option to join tables
activerecord/lib/rails/generators/active_record/migration/templates/migration.rb
の修正です。
join tableのmigrationを生成する際、association にreferences
オプションを指定出来るよう修正しています。
コミットログより。
bin/rails g migration CreateJoinTableShowroomUser showroom:references user:references
class CreateJoinTableShowroomUser < ActiveRecord::Migration[5.0] def change create_join_table :showrooms, :users do |t| t.references :showroom, foreign_key: true t.references :user, foreign_key: true end end end
references
オプションを指定しない場合、従来通りindex
メソッドを使用したmigrationファイルが生成されます。
bin/rails g migration CreateJoinTableShowroomUser showroom user
class CreateJoinTableShowroomUser < ActiveRecord::Migration[5.0] def change create_join_table :showrooms, :users do |t| # t.index [:showroom_id, :user_id] # t.index [:user_id, :showroom_id] end end end
index
だと別途外部キー制約しなくてはならなかったので、それをしないで済む分、便利そう。
activerecord/test/cases/adapters/postgresql/extension_migration_test.rb
の修正です。
変数名で、table
をtabel
にタイポしている箇所があったのを修正しています。
Fix documentation related to config.assets.cache_store
[ci skip]
rails guideのThe Asset Pipeline
、及びConfiguring Rails Applications
の修正です。
最新のsprocketsでは、assetsのcache storeをconfig.assets.cache_store
経由では設定出来なくなっているので、config.assets.cache_store
に関する説明を削除、代わりにconfig.assets.configure
経由で値を設定する必要があるので、その例を追加しています。
config.assets.configure do |env| env.cache = ActiveSupport::Cache.lookup_store(:memory_store, { size: 32.megabytes }) end