ar_mysql_flexmaster 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
13
  gem.name = "ar_mysql_flexmaster"
14
14
  gem.require_paths = ["lib"]
15
- gem.version = "0.4.3"
15
+ gem.version = "0.4.4"
16
16
 
17
17
  gem.add_runtime_dependency("mysql2")
18
18
  gem.add_runtime_dependency("activerecord")
@@ -77,6 +77,13 @@ module ActiveRecord
77
77
  super
78
78
  end
79
79
 
80
+ def quote_string(*args)
81
+ if !@connection
82
+ soft_verify
83
+ end
84
+ super
85
+ end
86
+
80
87
  def current_host
81
88
  @connection.query_options[:host]
82
89
  end
@@ -229,6 +229,14 @@ class TestArFlexmaster < Test::Unit::TestCase
229
229
  $mysql_master.up!
230
230
  end
231
231
 
232
+ def test_quote_string_should_recover_connection
233
+ User.create!
234
+ assert User.connection.instance_variable_get("@connection")
235
+ User.connection.instance_variable_set("@connection", nil)
236
+
237
+ assert User.connection.quote_string("foo")
238
+ end
239
+
232
240
  def test_recovering_after_the_master_is_back_up
233
241
  User.create!
234
242
  $mysql_master.down!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar_mysql_flexmaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-24 00:00:00.000000000 Z
12
+ date: 2013-06-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mysql2