switchman 1.2.18 → 1.2.19
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/spawn_methods.rb +2 -0
- data/lib/switchman/version.rb +1 -1
- data/lib/tasks/switchman.rake +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19a3f6517d1330ac30ba3ee4cb67a853eae0329d
|
4
|
+
data.tar.gz: 0b0b176329a529aecf9213f1cee9ecc6bc244414
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3b5c37e80c26d5bc460028b153119f5a8f6629822e8c2f456340fa330283cfdb0c0dd30717d7859a1e2626ed07481a6529f51af480b3a3ee7c71054a5ef3a6c
|
7
|
+
data.tar.gz: 66bcccb82d7203664ad393886924c0e7a8f2ebb93379795292f0fd56397045129d23f10cbc3a86ac9d44b3b7f4e2aa3fdf577cf7a7322003699cb07fe1d8b88c
|
@@ -82,6 +82,8 @@ module Switchman
|
|
82
82
|
end
|
83
83
|
else
|
84
84
|
def merge!(r)
|
85
|
+
return super unless r.is_a?(::ActiveRecord::Relation)
|
86
|
+
|
85
87
|
# have to figure out shard stuff *before* conditions are merged
|
86
88
|
final_shard_value, final_primary_shard, final_shard_source_value = shard_values_for_merge(r)
|
87
89
|
|
data/lib/switchman/version.rb
CHANGED
data/lib/tasks/switchman.rake
CHANGED
@@ -21,7 +21,7 @@ module Switchman
|
|
21
21
|
end
|
22
22
|
servers = servers.split(',')
|
23
23
|
conditions = ["database_server_id #{ "NOT " if negative }IN (?)", servers]
|
24
|
-
conditions.first << " OR database_server_id IS NULL" if servers.include?(Rails.env) && !negative || !servers.include?(Rails.env) && negative
|
24
|
+
conditions.first << " OR database_server_id IS NULL" if servers.include?(::Rails.env) && !negative || !servers.include?(::Rails.env) && negative
|
25
25
|
scope = scope.where(conditions)
|
26
26
|
end
|
27
27
|
|
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.2.
|
4
|
+
version: 1.2.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-09-
|
13
|
+
date: 2014-09-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: railties
|
@@ -390,7 +390,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
390
390
|
version: '0'
|
391
391
|
requirements: []
|
392
392
|
rubyforge_project:
|
393
|
-
rubygems_version: 2.
|
393
|
+
rubygems_version: 2.2.2
|
394
394
|
signing_key:
|
395
395
|
specification_version: 4
|
396
396
|
summary: Rails 3 sharding magic
|
@@ -603,4 +603,3 @@ test_files:
|
|
603
603
|
- spec/lib/shackles_spec.rb
|
604
604
|
- spec/models/shard_spec.rb
|
605
605
|
- spec/spec_helper.rb
|
606
|
-
has_rdoc:
|