master_slave_adapter 1.1.1 → 1.1.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.
@@ -1,3 +1,7 @@
1
+ # 1.1.2 (November 26, 2012)
2
+
3
+ * Avoid trying to connect to master twice if unavailable
4
+
1
5
  # 1.1.1 (November 17, 2012)
2
6
 
3
7
  * [BUGFIX] Fix activerecord 3.2 compatibility
@@ -210,6 +210,10 @@ module ActiveRecord
210
210
  connections.each { |connection| connection.clear_query_cache }
211
211
  end
212
212
 
213
+ def outside_transaction?
214
+ nil
215
+ end
216
+
213
217
  # ADAPTER INTERFACE DELEGATES ===========================================
214
218
 
215
219
  def self.rescued_delegate(*methods)
@@ -249,7 +253,6 @@ module ActiveRecord
249
253
  :release_savepoint,
250
254
  :current_savepoint_name,
251
255
  :begin_db_transaction,
252
- :outside_transaction?,
253
256
  :add_limit!,
254
257
  :default_sequence_name,
255
258
  :reset_sequence!,
@@ -1,7 +1,7 @@
1
1
  module ActiveRecord
2
2
  module ConnectionAdapters
3
3
  module MasterSlaveAdapter
4
- VERSION = "1.1.1"
4
+ VERSION = "1.1.2"
5
5
  end
6
6
  end
7
7
  end
@@ -183,8 +183,7 @@ describe ActiveRecord::ConnectionAdapters::MasterSlaveAdapter do
183
183
  %w(begin_db_transaction
184
184
  commit_db_transaction
185
185
  increment_open_transactions
186
- decrement_open_transactions
187
- outside_transaction?).each do |txstmt|
186
+ decrement_open_transactions).each do |txstmt|
188
187
  master_connection.
189
188
  should_receive(txstmt).exactly(1).times
190
189
  end
@@ -209,8 +208,7 @@ describe ActiveRecord::ConnectionAdapters::MasterSlaveAdapter do
209
208
  master_connection.
210
209
  should_receive(txstmt).exactly(1).times
211
210
  end
212
- master_connection.
213
- should_receive('outside_transaction?').exactly(2).times
211
+
214
212
  master_connection.
215
213
  should_receive('open_transactions').exactly(3).times.
216
214
  and_return(0, 1, 0)
@@ -107,8 +107,7 @@ shared_examples_for 'mysql consistency' do
107
107
  %w(begin_db_transaction
108
108
  commit_db_transaction
109
109
  increment_open_transactions
110
- decrement_open_transactions
111
- outside_transaction?).each do |txstmt|
110
+ decrement_open_transactions).each do |txstmt|
112
111
  master_connection.should_receive(txstmt).exactly(1).times
113
112
  end
114
113
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: master_slave_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2012-11-17 00:00:00.000000000 Z
18
+ date: 2012-11-26 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activerecord