switchman 1.9.6 → 1.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8f3e448e1f627fcd836971b4e1e866e43082987
4
- data.tar.gz: 204b5b664a1349b4e74652e18fbc66281d240f6f
3
+ metadata.gz: 5cb122072743392c94ee7f184136a0a54710618d
4
+ data.tar.gz: edd7dac621e1abb34fde5f727d55943789d79076
5
5
  SHA512:
6
- metadata.gz: 2ed76354d01310128a8a0003611810091bfa79b6148f2e7d58e3adef4d810fef6bbe4dc2f819cf2cfe61ac1ea91d86195e30a7da2490b8293afe406356eeaab5
7
- data.tar.gz: 0f78ee14df104f97acdf4dd01dea9d823f40c6b606d916d893c0273bfec6fd1b76d97014267163f1ec748f33e7e1f1fe522b1148f45d4a4e5df5cda88bbbdddd
6
+ metadata.gz: a64792365604ca68c6a7aa162ab073ec8820e3aa9944bb101e681fb5bd9b25caa29a4b207b0df283274e57b853315db2979981cf5f9f08ec43d0c1f1ffc86cd6
7
+ data.tar.gz: b4e6287a9bc2ea138aa4de7705c87a602c7dc8646d69791e149dba5b54855235b2ddda355544e1b26fdc76f96be37cf1b2fbe9a88b7b8f0025600c6594f25089
@@ -0,0 +1,13 @@
1
+ module Switchman
2
+ module ActiveRecord
3
+ module Migration
4
+ def connection
5
+ conn = super
6
+ if conn.shard != ::ActiveRecord::Base.connection_pool.current_pool.shard
7
+ ::ActiveRecord::Base.connection_pool.current_pool.switch_database(conn)
8
+ end
9
+ conn
10
+ end
11
+ end
12
+ end
13
+ end
@@ -72,6 +72,7 @@ module Switchman
72
72
  require "switchman/active_record/connection_pool"
73
73
  require "switchman/active_record/finder_methods"
74
74
  require "switchman/active_record/log_subscriber"
75
+ require "switchman/active_record/migration"
75
76
  require "switchman/active_record/model_schema"
76
77
  require "switchman/active_record/persistence"
77
78
  require "switchman/active_record/predicate_builder"
@@ -127,6 +128,8 @@ module Switchman
127
128
  ::ActiveRecord::ConnectionAdapters::QueryCache.send(:remove_method, :select_all) if ::Rails.version < '5.0.1'
128
129
 
129
130
  ::ActiveRecord::LogSubscriber.prepend(ActiveRecord::LogSubscriber)
131
+ ::ActiveRecord::Migration.prepend(ActiveRecord::Migration)
132
+
130
133
  ::ActiveRecord::Reflection::AbstractReflection.include(ActiveRecord::Reflection::AbstractReflection)
131
134
  ::ActiveRecord::Reflection::AssociationReflection.prepend(ActiveRecord::Reflection::AssociationScopeCache)
132
135
  ::ActiveRecord::Reflection::ThroughReflection.prepend(ActiveRecord::Reflection::AssociationScopeCache)
@@ -1,3 +1,3 @@
1
1
  module Switchman
2
- VERSION = "1.9.6"
2
+ VERSION = "1.9.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switchman
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.6
4
+ version: 1.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
@@ -189,6 +189,7 @@ files:
189
189
  - lib/switchman/active_record/connection_pool.rb
190
190
  - lib/switchman/active_record/finder_methods.rb
191
191
  - lib/switchman/active_record/log_subscriber.rb
192
+ - lib/switchman/active_record/migration.rb
192
193
  - lib/switchman/active_record/model_schema.rb
193
194
  - lib/switchman/active_record/persistence.rb
194
195
  - lib/switchman/active_record/postgresql_adapter.rb
@@ -242,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
243
  version: '0'
243
244
  requirements: []
244
245
  rubyforge_project:
245
- rubygems_version: 2.6.10
246
+ rubygems_version: 2.6.11
246
247
  signing_key:
247
248
  specification_version: 4
248
249
  summary: Rails 4 sharding magic