switchman 1.8.1 → 1.8.2

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: 50222908649b926ff4aadbe563d555b8e08bb6ef
4
- data.tar.gz: 1ed9670ef0a8e48243f9089f27c8defe49f95f51
3
+ metadata.gz: b82772037360a02f9f5767314b7f2a5619bb272a
4
+ data.tar.gz: b229555c12ad2f2af3527b5018d9a7c437eca543
5
5
  SHA512:
6
- metadata.gz: 96128751d37b322f381227b2c4326f683a34f1700853001f3a0071c033f584e204677c1d836c129c86cb856005bb321263e9ad5af67160cc7a551a909d894e59
7
- data.tar.gz: 3cda176ecdd6c7857b6e8d1bdfef3c43b08123d665fce3c3d35c2a11c007cc706ee47079e2755192d9a21d6112808bc403fe9e87e259c52c24aa4e5b0aefc68d
6
+ metadata.gz: 43e22952d819b022f6a525e3be7a79acbe8b4e7edf215713833c72a59d12e9a50ae155f46f511295d5ab5177746f9593f8e5dfda729cf747993780a2ee362cfb
7
+ data.tar.gz: e6e23bca697932bd9ac28828ffe3fd1c4a3a38db691c68a7cc569a720d01729811a98029eca3f8a5339ebb3d821544a0a8f14b289d76b927c32398d0b1110555
@@ -0,0 +1,11 @@
1
+ class AddBackDefaultStringLimitsSwitchman < ActiveRecord::Migration
2
+ def up
3
+ add_string_limit_if_missing :switchman_shards, :name
4
+ add_string_limit_if_missing :switchman_shards, :database_server_id
5
+ end
6
+
7
+ def add_string_limit_if_missing(table, column)
8
+ return if column_exists?(table, column, :string, limit: 255)
9
+ change_column table, column, :string, limit: 255
10
+ end
11
+ end
@@ -52,9 +52,9 @@ module Switchman
52
52
  relation = relation.where(table[primary_key].eq(conditions)) if conditions != :none
53
53
  end
54
54
 
55
- args = [relation, "#{name} Exists"]
56
- args << relation.bind_values
57
- relation.activate { return true if connection.select_value(*args) }
55
+ relation.activate do |shard_rel|
56
+ return true if connection.select_value(shard_rel, "#{name} Exists", shard_rel.bind_values)
57
+ end
58
58
  false
59
59
  end
60
60
  end
@@ -1,3 +1,3 @@
1
1
  module Switchman
2
- VERSION = "1.8.1"
2
+ VERSION = "1.8.2"
3
3
  end
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.8.1
4
+ version: 1.8.2
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: 2016-11-23 00:00:00.000000000 Z
13
+ date: 2016-12-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: railties
@@ -190,6 +190,7 @@ files:
190
190
  - app/models/switchman/shard_internal.rb
191
191
  - db/migrate/20130328212039_create_switchman_shards.rb
192
192
  - db/migrate/20130328224244_create_default_shard.rb
193
+ - db/migrate/20161206323434_add_back_default_string_limits_switchman.rb
193
194
  - lib/switchman.rb
194
195
  - lib/switchman/action_controller/caching.rb
195
196
  - lib/switchman/active_record/abstract_adapter.rb
@@ -254,8 +255,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
255
  version: '0'
255
256
  requirements: []
256
257
  rubyforge_project:
257
- rubygems_version: 2.5.2
258
+ rubygems_version: 2.6.7
258
259
  signing_key:
259
260
  specification_version: 4
260
261
  summary: Rails 4 sharding magic
261
262
  test_files: []
263
+ has_rdoc: