switchman 1.2.8 → 1.2.9
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/app/models/switchman/shard.rb +2 -2
- data/lib/switchman/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd5f72df8592b3efb7cc2e7719366b8df053e527
|
4
|
+
data.tar.gz: 4458254cf9f9d965736323e1621c8b11d262bc1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e42226c9cb67fd197902946e0f7be1c5a83970e213658e3abd0c7ecaf64122d3bb56be4c23be00751882d9c716ae39526bc60518d28f0426b844f8e7fe66c548
|
7
|
+
data.tar.gz: bd6525f1a509381e817f8ae8dbd039a522034ee20cac4c763df3dc14e9b1ae035ad9d8f3d5de3a60bda3274039b4eec05c3f99790b26da48b4aaab0882a93e6a
|
@@ -151,7 +151,7 @@ module Switchman
|
|
151
151
|
scope ||= Shard.order("database_server_id IS NOT NULL, database_server_id, id")
|
152
152
|
|
153
153
|
if parallel > 0
|
154
|
-
if scope.class == ::ActiveRecord::
|
154
|
+
if scope.class == ::ActiveRecord::Relation
|
155
155
|
# still need a post-uniq, cause the default database server could be NULL or Rails.env in the db
|
156
156
|
database_servers = scope.reorder('database_server_id').select(:database_server_id).uniq.
|
157
157
|
map(&:database_server).compact.uniq
|
@@ -190,7 +190,7 @@ module Switchman
|
|
190
190
|
pids = []
|
191
191
|
exception_pipe = IO.pipe
|
192
192
|
scopes.each do |server, subscopes|
|
193
|
-
if subscopes.first.class != ::ActiveRecord::
|
193
|
+
if subscopes.first.class != ::ActiveRecord::Relation && subscopes.first.class != Array
|
194
194
|
subscopes = [subscopes]
|
195
195
|
end
|
196
196
|
# only one process; don't bother forking
|
data/lib/switchman/version.rb
CHANGED
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.9
|
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-07-
|
13
|
+
date: 2014-07-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: railties
|
@@ -129,9 +129,11 @@ executables: []
|
|
129
129
|
extensions: []
|
130
130
|
extra_rdoc_files: []
|
131
131
|
files:
|
132
|
+
- Rakefile
|
132
133
|
- app/models/switchman/shard.rb
|
133
134
|
- db/migrate/20130328212039_create_switchman_shards.rb
|
134
135
|
- db/migrate/20130328224244_create_default_shard.rb
|
136
|
+
- lib/switchman.rb
|
135
137
|
- lib/switchman/action_controller/caching.rb
|
136
138
|
- lib/switchman/active_record/abstract_adapter.rb
|
137
139
|
- lib/switchman/active_record/association.rb
|
@@ -158,15 +160,15 @@ files:
|
|
158
160
|
- lib/switchman/sharded_instrumenter.rb
|
159
161
|
- lib/switchman/test_helper.rb
|
160
162
|
- lib/switchman/version.rb
|
161
|
-
- lib/switchman.rb
|
162
163
|
- lib/tasks/switchman.rake
|
163
|
-
- Rakefile
|
164
|
+
- spec/dummy/Rakefile
|
164
165
|
- spec/dummy/app/models/appendage.rb
|
165
166
|
- spec/dummy/app/models/digit.rb
|
166
167
|
- spec/dummy/app/models/feature.rb
|
167
168
|
- spec/dummy/app/models/mirror_user.rb
|
168
169
|
- spec/dummy/app/models/root.rb
|
169
170
|
- spec/dummy/app/models/user.rb
|
171
|
+
- spec/dummy/config.ru
|
170
172
|
- spec/dummy/config/application.rb
|
171
173
|
- spec/dummy/config/boot.rb
|
172
174
|
- spec/dummy/config/database.yml
|
@@ -180,7 +182,6 @@ files:
|
|
180
182
|
- spec/dummy/config/initializers/session_store.rb
|
181
183
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
182
184
|
- spec/dummy/config/routes.rb
|
183
|
-
- spec/dummy/config.ru
|
184
185
|
- spec/dummy/db/development.sqlite3
|
185
186
|
- spec/dummy/db/migrate/20130403132607_create_users.rb
|
186
187
|
- spec/dummy/db/migrate/20130411202442_create_appendages.rb
|
@@ -191,7 +192,6 @@ files:
|
|
191
192
|
- spec/dummy/db/migrate/20140219183820_create_roots.rb
|
192
193
|
- spec/dummy/db/schema.rb
|
193
194
|
- spec/dummy/log/development.log
|
194
|
-
- spec/dummy/Rakefile
|
195
195
|
- spec/dummy/script/rails
|
196
196
|
- spec/lib/action_controller/caching_spec.rb
|
197
197
|
- spec/lib/active_record/abstract_adapter_spec.rb
|
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
234
|
version: '0'
|
235
235
|
requirements: []
|
236
236
|
rubyforge_project:
|
237
|
-
rubygems_version: 2.0
|
237
|
+
rubygems_version: 2.3.0
|
238
238
|
signing_key:
|
239
239
|
specification_version: 4
|
240
240
|
summary: Rails 3 sharding magic
|
@@ -292,3 +292,4 @@ test_files:
|
|
292
292
|
- spec/lib/shackles_spec.rb
|
293
293
|
- spec/models/shard_spec.rb
|
294
294
|
- spec/spec_helper.rb
|
295
|
+
has_rdoc:
|