activerecord-sqlserver-adapter-mirroring 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -52,11 +52,14 @@ module ActiveRecord
52
52
  end
53
53
 
54
54
  def switch_to_mirror
55
- mirror_root = @connection_options[:mirror] || @connection_options['mirror']
56
- mirror_root.each_key do |key|
57
- tmp = mirror_root[key]
58
- mirror_root[key] = @connection_options[key.to_sym] || @connection_options[key]
59
- @connection_options[key.to_sym] = tmp
55
+ #make deep copy, so we don't change orignal config
56
+ @connection_options = Marshal.load(Marshal.dump(@connection_options))
57
+ @connection_options.symbolize_keys!
58
+ @connection_options[:mirror].symbolize_keys!
59
+
60
+ @connection_options[:mirror].each_key do |key|
61
+ tmp = @connection_options[:mirror][key]
62
+ @connection_options[:mirror][key] = @connection_options[key]
60
63
  @connection_options[key] = tmp
61
64
  end
62
65
  end
@@ -19,7 +19,7 @@ class TestMirroring < ActiveRecord::TestCase
19
19
  assert_equal 2, Programmer.count
20
20
 
21
21
  failover
22
-
22
+
23
23
  Programmer.create(:first_name => "Vedran", :last_name => "Skrnjug")
24
24
  assert_equal 3, Programmer.count
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-sqlserver-adapter-mirroring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord-sqlserver-adapter
16
- requirement: &70316027548400 !ruby/object:Gem::Requirement
16
+ requirement: &70354223588080 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 3.2.3
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70316027548400
24
+ version_requirements: *70354223588080
25
25
  description: Database mirroring support for Rails activerecord-sqlserver-adapter
26
26
  email:
27
27
  - ianic@minus5.hr