active_record_shards 3.7.2 → 3.7.3

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: 7cd066dedaafc888517b5363be4efc2d812cb85e
4
- data.tar.gz: 1fe39d92a3875a9b4b2f36dd4bdfc1d94dee8047
3
+ metadata.gz: 991ef99036b5e7be505d7112ba36955786e7db0f
4
+ data.tar.gz: 317d2333d2ad5e9bb4b48ea9df88badebb52a537
5
5
  SHA512:
6
- metadata.gz: 7c48a0f57a841dca2eb11960527fbb8f81d5e38e86ce4e2e0097ab43e8059776603e571a26264341ecd6b7201a31b8bf30470d090bb1c6c646bcedca1af9ddee
7
- data.tar.gz: beab57cf1269253638b4a6653dcf3351748fac968e49f42dc67f0670c7f0c03b6cc28e5594809c55fc7ea724d41b4de552ee89dfb2dcd7ae18ed91bd106d811e
6
+ metadata.gz: baf2255b7fc6aab8565693504b34973a461ae56f2c161bcb812b068daea8afdbf7e72914bbcb29456e78da31cee142e786e272cf9e4c5f9da1afa1775c44f0aa
7
+ data.tar.gz: dfb56f0a511b9e96829eb84f279e354311c07997bf9c84eba18d4886220b749d7278a92028b112d7ef21b96e855b532caa14a2f572761395a95b12dc43d2b600
@@ -21,7 +21,9 @@ module ActiveRecordShards
21
21
  name = connection_pool_name
22
22
  spec = configurations[name]
23
23
 
24
- raise(ActiveRecord::AdapterNotSpecified, "No database defined by #{name} in database.yml") if spec.nil?
24
+ if spec.nil?
25
+ raise ActiveRecord::AdapterNotSpecified, "No database defined by #{name} in database.yml"
26
+ end
25
27
 
26
28
  # in 3.2 rails is asking for a connection pool in a map of these ConnectionSpecifications. If we want to re-use connections,
27
29
  # we need to re-use specs.
@@ -3,7 +3,10 @@ module ActiveRecordShards
3
3
  def connection_specification_name
4
4
  name = current_shard_selection.resolve_connection_name(sharded: is_sharded?, configurations: configurations)
5
5
 
6
- raise "No configuration found for #{name}" unless configurations[name] || name == "primary"
6
+ unless configurations[name] || name == "primary"
7
+ raise ActiveRecord::AdapterNotSpecified, "No database defined by #{name} in database.yml"
8
+ end
9
+
7
10
  name
8
11
  end
9
12
 
@@ -35,11 +35,13 @@ module ActiveRecord
35
35
  end
36
36
 
37
37
  # don't allow Migrator class to cache versions
38
+ undef migrated
38
39
  def migrated
39
40
  self.class.get_all_versions
40
41
  end
41
42
 
42
43
  # list of pending migrations is any migrations that haven't run on all shards.
44
+ undef pending_migrations
43
45
  def pending_migrations
44
46
  pending, _missing = self.class.shard_status(migrations.map(&:version))
45
47
  pending = pending.values.flatten
@@ -6,6 +6,7 @@ module ActiveRecordShards
6
6
 
7
7
  def initialize
8
8
  @on_slave = false
9
+ @shard = nil
9
10
  end
10
11
 
11
12
  if ActiveRecord::VERSION::MAJOR < 5
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_shards
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.2
4
+ version: 3.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-09-22 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: activerecord
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
228
  version: '0'
229
229
  requirements: []
230
230
  rubyforge_project:
231
- rubygems_version: 2.4.5.1
231
+ rubygems_version: 2.5.2
232
232
  signing_key:
233
233
  specification_version: 4
234
234
  summary: Simple database switching for ActiveRecord.