switchman 3.2.0 → 3.2.1
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/statement_cache.rb +7 -3
- data/lib/switchman/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20c8d947a29c73c09af7d1c880ef03aff2185c927d30954bb304b4592a7b4051
|
4
|
+
data.tar.gz: 5973474196cc2c8f2957932a65261998de24a6be3653cedeff374c1fe1fa925f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10f59abb9c44a3b6e8ec3e87419862f5959ec8086117172d6fc044911c0efb3d96ec320fc04630e482200fbf99da4a7a8d7a291137bbf9ce019f1e7a54f5eeb0
|
7
|
+
data.tar.gz: 72fc286e4f143bf9d8344aa6e4a0405161e476b23eada4fd956f2657a1911c4e93acad649e76cb17e444821060085110d12c2cfe0a5f115bf9b7ddc598fb17ea
|
@@ -25,7 +25,7 @@ module Switchman
|
|
25
25
|
# we can make some assumptions about the shard source
|
26
26
|
# (e.g. infer from the primary key or use the current shard)
|
27
27
|
|
28
|
-
def execute(*args)
|
28
|
+
def execute(*args, &block)
|
29
29
|
params, connection = args
|
30
30
|
klass = @klass
|
31
31
|
target_shard = nil
|
@@ -40,7 +40,7 @@ module Switchman
|
|
40
40
|
|
41
41
|
target_shard.activate(klass.connection_class_for_self) do
|
42
42
|
sql = qualified_query_builder(target_shard, klass).sql_for(bind_values, connection)
|
43
|
-
klass.find_by_sql(sql, bind_values)
|
43
|
+
klass.find_by_sql(sql, bind_values, &block)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -66,7 +66,11 @@ module Switchman
|
|
66
66
|
|
67
67
|
def primary_value_index
|
68
68
|
primary_ba_index = @bound_attributes.index do |ba|
|
69
|
-
ba.is_a?(::ActiveRecord::
|
69
|
+
if ba.value.is_a?(::ActiveRecord::StatementCache::Substitute)
|
70
|
+
ba.is_a?(::ActiveRecord::Relation::QueryAttribute) && ba.value.primary
|
71
|
+
else
|
72
|
+
false
|
73
|
+
end
|
70
74
|
end
|
71
75
|
@indexes.index(primary_ba_index) if primary_ba_index
|
72
76
|
end
|
data/lib/switchman/version.rb
CHANGED