switchman 1.12.0 → 1.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4cbaba3af0fb2692fd3e75ec8ca0d76c2dfcc187
4
- data.tar.gz: 1a6fd4d0e9b20174505d6421e819f46ab47e60aa
3
+ metadata.gz: d7f51b0f73ecf8a120874ea26b445667fec18f05
4
+ data.tar.gz: b5a6230b66f1ada9c4e43723455e3a2e89d1b890
5
5
  SHA512:
6
- metadata.gz: 2f7720c65be9c6dd30af6b8a21e6dad2b9ba6028d2ab743cd03a941cae96fb69c245b3935adc48e725e3361458052f2e28f2ac6bbc4c92a0641241c24b5a5ff5
7
- data.tar.gz: a9f90607b3362d9f32530e99b17bded68cda2a5f4733c79916e0c1b0fa84a4f33ded8c43c3c9afefcb457e5a5fc4bb2a7e97e5b4e3b30e9d17ba81603050a7a5
6
+ metadata.gz: fe5d162dd3898d974f646821b20530657e98ff432c31900a924668852df2ab745c2bf9b9dee8f43dab50d02b0085f320c9b5e64804ba4c87166c94f15f4be47a
7
+ data.tar.gz: ac04c1e4f2908c1361e95f1d13a6fccf014c2f0a15b4ff2277a0a0e60afa8d53041e96204b0f1e71331ab8187eaec81fb909d286c3ccb78938e2a60902d820e4
@@ -185,7 +185,7 @@ module Switchman
185
185
 
186
186
  scope ||= Shard.all
187
187
  if ::ActiveRecord::Relation === scope && scope.order_values.empty?
188
- scope = scope.order("database_server_id IS NOT NULL, database_server_id, id")
188
+ scope = scope.order(::Arel.sql("database_server_id IS NOT NULL, database_server_id, id"))
189
189
  end
190
190
 
191
191
  if parallel > 0
@@ -2,7 +2,7 @@ module Switchman
2
2
  module ActiveRecord
3
3
  module Batches
4
4
  def batch_order
5
- "#{connection.quote_local_table_name(table_name)}.#{quoted_primary_key} ASC"
5
+ ::Arel.sql("#{connection.quote_local_table_name(table_name)}.#{quoted_primary_key} ASC")
6
6
  end
7
7
  end
8
8
  end
@@ -5,6 +5,12 @@ module Switchman
5
5
  def touch(*)
6
6
  shard.activate(self.class.shard_category) { super }
7
7
  end
8
+
9
+ if ::Rails.version >= '5.2'
10
+ def update_columns(*)
11
+ shard.activate(self.class.shard_category) { super }
12
+ end
13
+ end
8
14
  end
9
15
  end
10
16
  end
@@ -1,3 +1,3 @@
1
1
  module Switchman
2
- VERSION = "1.12.0"
2
+ VERSION = "1.12.1"
3
3
  end
@@ -26,7 +26,7 @@ module Switchman
26
26
 
27
27
  servers = filter_database_servers_chain.call(servers)
28
28
 
29
- scope = base_scope.order("database_server_id IS NOT NULL, database_server_id, id")
29
+ scope = base_scope.order(::Arel.sql("database_server_id IS NOT NULL, database_server_id, id"))
30
30
  if servers != DatabaseServer.all
31
31
  conditions = ["database_server_id IN (?)", servers.map(&:id)]
32
32
  conditions.first << " OR database_server_id IS NULL" if servers.include?(Shard.default.database_server)
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.12.0
4
+ version: 1.12.1
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: 2018-04-10 00:00:00.000000000 Z
13
+ date: 2018-04-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: railties