active_record_shards 3.9.1 → 3.9.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5eaf3339acdbdbfd5a5e69de209999bcdee61f0a
4
- data.tar.gz: 0c08479308dd97ec3b96d319582a7ba967142727
3
+ metadata.gz: 81a720c8a58e8f5108776bb9521d96a0655b4716
4
+ data.tar.gz: 2766cade5b7e607dc1f7bc941ba006f30f85cdc1
5
5
  SHA512:
6
- metadata.gz: 258f24f35992d4bc243c0e7076346c4da3777be04de94feb7bb86b1d07956d0e2329474d7b912aaca8bfe2fd58f99aac551fb26a8419cb13c97f807548f194c5
7
- data.tar.gz: 422849bea3e139723574b745eb1dae664d19e5d8e4eb48bda314f0841c39aa86497cd52113f4fc7049a918429d122962cfd3ec5bad044792446c90caaa4c8732
6
+ metadata.gz: bb3cbaf2517378f2bacb72dc2c2b9712c41e17d34831db3dab1db29510e1ca7216730e6b7d56538610495a8efe018ebc9ab1693e72947c934a638391bc67b549
7
+ data.tar.gz: a56dc45cc5f35cd291e10055463c4c33e30d8c99c4bd21a23f493ccfa40c74f4a8e0cb2b06f511b9bda4678c3a82871a55808320b6c0a7d049bd5b624e68efe8
@@ -98,13 +98,6 @@ module ActiveRecordShards
98
98
  [:calculate, :exists?, :pluck, :find_with_associations].each do |m|
99
99
  ActiveRecordShards::DefaultSlavePatches.wrap_method_in_on_slave(false, base, m)
100
100
  end
101
-
102
- # ActiveRecord::Explain in v3 will eagerly establish an on_master
103
- # connection just to just the _static_ `supports_explain?` method on
104
- # the Mysql2Adapter
105
- if ActiveRecord::VERSION::MAJOR == 3
106
- ActiveRecordShards::DefaultSlavePatches.wrap_method_in_on_slave(false, base, :logging_query_plan)
107
- end
108
101
  end
109
102
 
110
103
  def on_slave_unless_tx
@@ -1,22 +1,22 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ActiveRecordShards
3
4
  module Model
4
5
  def not_sharded
5
6
  if self != ActiveRecord::Base && self != base_class
6
7
  raise "You should only call not_sharded on direct descendants of ActiveRecord::Base"
7
8
  end
8
- @sharded = false
9
+ self.sharded = false
9
10
  end
10
11
 
11
12
  def is_sharded? # rubocop:disable Style/PredicateName
12
- sharded_ivar = defined?(@sharded) ? @sharded : nil
13
13
  if self == ActiveRecord::Base
14
- sharded_ivar != false && supports_sharding?
14
+ sharded != false && supports_sharding?
15
15
  elsif self == base_class
16
- if sharded_ivar.nil?
16
+ if sharded.nil?
17
17
  ActiveRecord::Base.is_sharded?
18
18
  else
19
- sharded_ivar != false
19
+ sharded != false
20
20
  end
21
21
  else
22
22
  base_class.is_sharded?
@@ -58,5 +58,6 @@ module ActiveRecordShards
58
58
  private
59
59
 
60
60
  attr_reader :on_slave_by_default
61
+ attr_accessor :sharded
61
62
  end
62
63
  end
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.9.1
4
+ version: 3.9.2
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: 2017-03-29 00:00:00.000000000 Z
13
+ date: 2017-06-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 0.42.0
117
+ version: 0.48.1
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 0.42.0
124
+ version: 0.48.1
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: minitest
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -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.6.11
231
+ rubygems_version: 2.5.1
232
232
  signing_key:
233
233
  specification_version: 4
234
234
  summary: Simple database switching for ActiveRecord.