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 +4 -4
- data/lib/switchman/active_record/migration.rb +13 -0
- data/lib/switchman/engine.rb +3 -0
- data/lib/switchman/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5cb122072743392c94ee7f184136a0a54710618d
|
|
4
|
+
data.tar.gz: edd7dac621e1abb34fde5f727d55943789d79076
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/switchman/engine.rb
CHANGED
|
@@ -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)
|
data/lib/switchman/version.rb
CHANGED
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.
|
|
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.
|
|
246
|
+
rubygems_version: 2.6.11
|
|
246
247
|
signing_key:
|
|
247
248
|
specification_version: 4
|
|
248
249
|
summary: Rails 4 sharding magic
|