active_record_shards 3.3.8 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_record_shards/model.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c48575c9907cac72f3a71adb3fd5e1682908c6f3
|
4
|
+
data.tar.gz: b70f89745d6522f1305bf4c453ee20201f7689d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1800ad20d9bd1b19f3e67b7212bca66ac80679ec0586eae5bebe83d232babc1946ec46f1778f9a635e477efc72f073812b2b7b7b00dceac6409fe342f003cb49
|
7
|
+
data.tar.gz: 82af6aa117265314f780e5b5061b42a61507ec20b1da93d71adb36dff3f14e74f83aea154f6fe10a2353b20f0182372ca28581f18d1e5249a76bb7db799762ce
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ActiveRecordShards
|
2
2
|
module Model
|
3
3
|
def not_sharded
|
4
|
-
if self
|
4
|
+
if self != ActiveRecord::Base && self != base_class
|
5
5
|
raise "You should only call not_sharded on direct descendants of ActiveRecord::Base"
|
6
6
|
end
|
7
7
|
@sharded = false
|
@@ -9,7 +9,7 @@ module ActiveRecordShards
|
|
9
9
|
|
10
10
|
def is_sharded?
|
11
11
|
if self == ActiveRecord::Base
|
12
|
-
supports_sharding?
|
12
|
+
@sharded != false && supports_sharding?
|
13
13
|
elsif self == base_class
|
14
14
|
if @sharded.nil?
|
15
15
|
ActiveRecord::Base.is_sharded?
|