switchman 2.1.3 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/switchman/active_record/base.rb +10 -10
- data/lib/switchman/engine.rb +1 -1
- data/lib/switchman/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d96c8878af2c919433712e502ab527fd77e811eeb88a652357cc004fb5a40ac7
|
4
|
+
data.tar.gz: b8f9e1cb90e7dfbfb25ea02a8699a6c8e20d305f60a13f062a1d71d1da27816e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb9130947cbff85fef69fdb3f3ac54c29aa9cf7f95507faf92ac97673828addeebe58c9ff1fc478ff34daa834e2f42774a81a99b5bd42dde7e06e3fd63ff6dca
|
7
|
+
data.tar.gz: 1e9fd256868e5b35a0f8d34c5726af34bc7381d76f77f9988d623da84b510959a4ff8563956c797c4921961a8540dd1f8fe74882df9027b4946b93e087309284
|
@@ -80,17 +80,17 @@ module Switchman
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
def self.
|
84
|
-
klass.
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
end
|
83
|
+
def self.prepended(klass)
|
84
|
+
klass.singleton_class.prepend(ClassMethods)
|
85
|
+
end
|
86
|
+
|
87
|
+
def _run_initialize_callbacks
|
88
|
+
@shard ||= if self.class.sharded_primary_key?
|
89
|
+
Shard.shard_for(self[self.class.primary_key], Shard.current(self.class.shard_category))
|
90
|
+
else
|
91
|
+
Shard.current(self.class.shard_category)
|
93
92
|
end
|
93
|
+
super
|
94
94
|
end
|
95
95
|
|
96
96
|
def shard
|
data/lib/switchman/engine.rb
CHANGED
@@ -95,7 +95,7 @@ module Switchman
|
|
95
95
|
|
96
96
|
::StandardError.include(StandardError)
|
97
97
|
|
98
|
-
|
98
|
+
prepend ActiveRecord::Base
|
99
99
|
include ActiveRecord::AttributeMethods
|
100
100
|
include ActiveRecord::Persistence
|
101
101
|
singleton_class.prepend ActiveRecord::ModelSchema::ClassMethods
|
data/lib/switchman/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: switchman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
8
8
|
- James Williams
|
9
9
|
- Jacob Fugal
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
date: 2021-07-29 00:00:00.000000000 Z
|
@@ -257,7 +257,7 @@ homepage: http://www.instructure.com/
|
|
257
257
|
licenses:
|
258
258
|
- MIT
|
259
259
|
metadata: {}
|
260
|
-
post_install_message:
|
260
|
+
post_install_message:
|
261
261
|
rdoc_options: []
|
262
262
|
require_paths:
|
263
263
|
- lib
|
@@ -272,8 +272,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
272
272
|
- !ruby/object:Gem::Version
|
273
273
|
version: '0'
|
274
274
|
requirements: []
|
275
|
-
rubygems_version: 3.
|
276
|
-
signing_key:
|
275
|
+
rubygems_version: 3.0.3
|
276
|
+
signing_key:
|
277
277
|
specification_version: 4
|
278
278
|
summary: Rails sharding magic
|
279
279
|
test_files: []
|