db-charmer 1.6.6 → 1.6.7

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.
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ 1.6.7 (2010-04-07):
2
+
3
+ Changed the way we handle associations in on_db(:foo).find(:include) calls. Now we
4
+ switch association's connection only if its default connection is the same as the
5
+ master model's connection (not more "table does not exist" problems I hope).
6
+
1
7
  1.6.5 (2010-04-05):
2
8
 
3
9
  Bugfix release: Fixed :connection vs :slave in db_magic behaviour. Model.on_master should
@@ -135,6 +135,10 @@ in your single database (especially useful in test databases).
135
135
  This behaviour is controlled by the <tt>DbCharmer.connections_should_exist</tt>
136
136
  configuration attribute which could be set from a rails initializer.
137
137
 
138
+ Warning: if in test environment you use separate connections and master-slave support
139
+ in DbCharmer, make sure you disable transactional fixtures support in Rails. Without
140
+ this change you're going to see all kinds of weird data visibility problems in your tests.
141
+
138
142
 
139
143
  == Using Models in Master-Slave Environments
140
144
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.6
1
+ 1.6.7
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{db-charmer}
8
- s.version = "1.6.6"
8
+ s.version = "1.6.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexey Kovyrin"]
12
- s.date = %q{2010-04-05}
12
+ s.date = %q{2010-04-07}
13
13
  s.description = %q{ActiveRecord Connections Magic (slaves, multiple connections, etc)}
14
14
  s.email = %q{alexey@kovyrin.net}
15
15
  s.extra_rdoc_files = [
@@ -49,7 +49,7 @@ Gem::Specification.new do |s|
49
49
  s.homepage = %q{http://github.com/kovyrin/db-charmer}
50
50
  s.rdoc_options = ["--charset=UTF-8"]
51
51
  s.require_paths = ["lib"]
52
- s.rubygems_version = %q{1.3.6}
52
+ s.rubygems_version = %q{1.3.5}
53
53
  s.summary = %q{ActiveRecord Connections Magic}
54
54
 
55
55
  if s.respond_to? :specification_version then
@@ -5,7 +5,9 @@ module DbCharmer
5
5
  ASSOCIATION_TYPES.each do |association_type|
6
6
  class_eval <<-EOF, __FILE__, __LINE__ + 1
7
7
  def preload_#{association_type}_association(records, reflection, preload_options = {})
8
- return super(records, reflection, preload_options) if self.db_charmer_top_level_connection?
8
+ if self.db_charmer_top_level_connection? || self.db_charmer_default_connection != reflection.klass.db_charmer_default_connection
9
+ return super(records, reflection, preload_options)
10
+ end
9
11
  reflection.klass.on_db(self) do
10
12
  super(records, reflection, preload_options)
11
13
  end
metadata CHANGED
@@ -1,12 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db-charmer
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 6
8
- - 6
9
- version: 1.6.6
4
+ version: 1.6.7
10
5
  platform: ruby
11
6
  authors:
12
7
  - Alexey Kovyrin
@@ -14,35 +9,29 @@ autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
11
 
17
- date: 2010-04-05 00:00:00 -04:00
12
+ date: 2010-04-07 00:00:00 -04:00
18
13
  default_executable:
19
14
  dependencies:
20
15
  - !ruby/object:Gem::Dependency
21
16
  name: rails
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
24
20
  requirements:
25
21
  - - ">="
26
22
  - !ruby/object:Gem::Version
27
- segments:
28
- - 2
29
- - 2
30
- - 0
31
23
  version: 2.2.0
32
- type: :runtime
33
- version_requirements: *id001
24
+ version:
34
25
  - !ruby/object:Gem::Dependency
35
26
  name: blankslate
36
- prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
38
30
  requirements:
39
31
  - - ">="
40
32
  - !ruby/object:Gem::Version
41
- segments:
42
- - 0
43
33
  version: "0"
44
- type: :runtime
45
- version_requirements: *id002
34
+ version:
46
35
  description: ActiveRecord Connections Magic (slaves, multiple connections, etc)
47
36
  email: alexey@kovyrin.net
48
37
  executables: []
@@ -94,20 +83,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
94
83
  requirements:
95
84
  - - ">="
96
85
  - !ruby/object:Gem::Version
97
- segments:
98
- - 0
99
86
  version: "0"
87
+ version:
100
88
  required_rubygems_version: !ruby/object:Gem::Requirement
101
89
  requirements:
102
90
  - - ">="
103
91
  - !ruby/object:Gem::Version
104
- segments:
105
- - 0
106
92
  version: "0"
93
+ version:
107
94
  requirements: []
108
95
 
109
96
  rubyforge_project:
110
- rubygems_version: 1.3.6
97
+ rubygems_version: 1.3.5
111
98
  signing_key:
112
99
  specification_version: 3
113
100
  summary: ActiveRecord Connections Magic