bowtie 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{bowtie}
3
- s.version = "0.5.6"
3
+ s.version = "0.5.7"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Tomás Pollak"]
@@ -141,6 +141,16 @@ module DataMapper::Resource
141
141
 
142
142
  end
143
143
 
144
- Bowtie.models.each do |mod|
145
- mod.extend Bowtie::ClassMethods
144
+ if Bowtie.models.empty? # models not loaded yet
145
+
146
+ class Class # need to figure out how to extend *only* DM models
147
+ include Bowtie::ClassMethods
148
+ end
149
+
150
+ else
151
+
152
+ Bowtie.models.each do |mod|
153
+ mod.extend Bowtie::ClassMethods
154
+ end
155
+
146
156
  end
@@ -129,6 +129,20 @@ module MongoMapper::Document
129
129
 
130
130
  end
131
131
 
132
- Bowtie.models.each do |mod|
133
- mod.extend Bowtie::ClassMethods
132
+ if Bowtie.models.empty? # models not loaded yet
133
+
134
+ module MongoMapper::Document
135
+
136
+ included do
137
+ extend Bowtie::ClassMethods
138
+ end
139
+
140
+ end
141
+
142
+ else
143
+
144
+ Bowtie.models.each do |mod|
145
+ mod.extend Bowtie::ClassMethods
146
+ end
147
+
134
148
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bowtie
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 6
10
- version: 0.5.6
9
+ - 7
10
+ version: 0.5.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Tom\xC3\xA1s Pollak"