diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | actioncable/test/client_test.rb | 21 | ||||
-rw-r--r-- | activerecord/lib/active_record/railtie.rb | 8 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/dup_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/primary_keys_test.rb | 2 | ||||
-rw-r--r-- | guides/assets/stylesheets/main.css | 1 | ||||
-rw-r--r-- | railties/lib/rails/backtrace_cleaner.rb | 2 | ||||
-rw-r--r-- | railties/test/application/initializers/frameworks_test.rb | 8 |
9 files changed, 40 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml index b70d3892c1..af19cd41de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -105,7 +105,7 @@ matrix: env: - "GEM=am,amo,aj" # Test with old (< 9.4.2) postgresql - - rvm: 2.4.0 + - rvm: 2.4.1 env: - "GEM=ar:postgresql" addons: diff --git a/actioncable/test/client_test.rb b/actioncable/test/client_test.rb index 98a114a5f4..4f7c585ba3 100644 --- a/actioncable/test/client_test.rb +++ b/actioncable/test/client_test.rb @@ -68,12 +68,23 @@ class ClientTest < ActionCable::TestCase server.min_threads = 1 server.max_threads = 4 - t = Thread.new { server.run.join } - yield port + thread = server.run - ensure - server.stop(true) if server - t.join if t + begin + yield port + + ensure + server.stop + + begin + thread.join + rescue RuntimeError => ex + raise unless ex.message =~ /can't modify frozen IOError/ + + # Work around https://bugs.ruby-lang.org/issues/13239 + server.binder.close + end + end end class SyncClient diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index 0276d41494..73518ca144 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -166,5 +166,13 @@ end_warning path = app.paths["db"].first config.watchable_files.concat ["#{path}/schema.rb", "#{path}/structure.sql"] end + + initializer "active_record.clear_active_connections" do + config.after_initialize do + ActiveSupport.on_load(:active_record) do + clear_active_connections! + end + end + end end end diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 34a3615070..5d24f5f5ca 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -224,7 +224,7 @@ module ActiveRecord fifth || raise_record_not_found_exception! end - # Find the forty-second record. Also known as accessing "the answer to life the universe and everything". + # Find the forty-second record. Also known as accessing "the reddit". # If no order is defined it will order by primary key. # # Person.forty_two # returns the forty-second object fetched by SELECT * FROM people diff --git a/activerecord/test/cases/dup_test.rb b/activerecord/test/cases/dup_test.rb index 3821e0c949..000ed27efb 100644 --- a/activerecord/test/cases/dup_test.rb +++ b/activerecord/test/cases/dup_test.rb @@ -143,6 +143,8 @@ module ActiveRecord end def test_dup_without_primary_key + skip if current_adapter?(:OracleAdapter) + klass = Class.new(ActiveRecord::Base) do self.table_name = "parrots_pirates" end diff --git a/activerecord/test/cases/primary_keys_test.rb b/activerecord/test/cases/primary_keys_test.rb index 12386635f6..5ded619716 100644 --- a/activerecord/test/cases/primary_keys_test.rb +++ b/activerecord/test/cases/primary_keys_test.rb @@ -183,6 +183,8 @@ class PrimaryKeysTest < ActiveRecord::TestCase end def test_create_without_primary_key_no_extra_query + skip if current_adapter?(:OracleAdapter) + klass = Class.new(ActiveRecord::Base) do self.table_name = "dashboards" end diff --git a/guides/assets/stylesheets/main.css b/guides/assets/stylesheets/main.css index a1e4851833..b27776745a 100644 --- a/guides/assets/stylesheets/main.css +++ b/guides/assets/stylesheets/main.css @@ -294,6 +294,7 @@ a, a:link, a:visited { #mainCol a, #subCol a, #feature a {color: #980905;} #mainCol a code, #subCol a code, #feature a code {color: #980905;} +#mainCol a.anchorlink, #mainCol a.anchorlink code {color: #333;} #mainCol a.anchorlink { text-decoration: none; } #mainCol a.anchorlink:hover { text-decoration: underline; } diff --git a/railties/lib/rails/backtrace_cleaner.rb b/railties/lib/rails/backtrace_cleaner.rb index 5c833e12ba..3bd18ebfb5 100644 --- a/railties/lib/rails/backtrace_cleaner.rb +++ b/railties/lib/rails/backtrace_cleaner.rb @@ -16,7 +16,7 @@ module Rails add_filter { |line| line.sub(DOT_SLASH, SLASH) } # for tests add_gem_filters - add_silencer { |line| line !~ APP_DIRS_PATTERN } + add_silencer { |line| !APP_DIRS_PATTERN.match?(line) } end private diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb index 90927159dd..eb2c578f91 100644 --- a/railties/test/application/initializers/frameworks_test.rb +++ b/railties/test/application/initializers/frameworks_test.rb @@ -262,5 +262,13 @@ module ApplicationTests Rails.env = orig_rails_env if orig_rails_env end end + + test "connections checked out during initialization are returned to the pool" do + app_file "config/initializers/active_record.rb", <<-RUBY + ActiveRecord::Base.connection + RUBY + require "#{app_path}/config/environment" + assert !ActiveRecord::Base.connection_pool.active_connection? + end end end |