orm_adapter 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,110 +1,115 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- orm_adapter (0.0.5)
4
+ orm_adapter (0.0.6)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
8
8
  specs:
9
- activemodel (3.0.7)
10
- activesupport (= 3.0.7)
11
- builder (~> 2.1.2)
12
- i18n (~> 0.5.0)
13
- activerecord (3.0.7)
14
- activemodel (= 3.0.7)
15
- activesupport (= 3.0.7)
16
- arel (~> 2.0.2)
17
- tzinfo (~> 0.3.23)
18
- activesupport (3.0.7)
19
- addressable (2.2.5)
20
- arel (2.0.9)
21
- bcrypt-ruby (2.1.4)
22
- bson (1.3.0)
23
- bson_ext (1.3.0)
24
- builder (2.1.2)
25
- data_objects (0.10.5)
9
+ activemodel (3.1.3)
10
+ activesupport (= 3.1.3)
11
+ builder (~> 3.0.0)
12
+ i18n (~> 0.6)
13
+ activerecord (3.1.3)
14
+ activemodel (= 3.1.3)
15
+ activesupport (= 3.1.3)
16
+ arel (~> 2.2.1)
17
+ tzinfo (~> 0.3.29)
18
+ activesupport (3.1.3)
19
+ multi_json (~> 1.0)
20
+ addressable (2.2.6)
21
+ arel (2.2.1)
22
+ bcrypt-ruby (3.0.1)
23
+ bson (1.5.2)
24
+ bson_ext (1.5.2)
25
+ bson (= 1.5.2)
26
+ builder (3.0.0)
27
+ data_objects (0.10.7)
26
28
  addressable (~> 2.1)
27
- datamapper (1.1.0)
28
- dm-aggregates (= 1.1.0)
29
- dm-constraints (= 1.1.0)
30
- dm-core (= 1.1.0)
31
- dm-migrations (= 1.1.0)
32
- dm-serializer (= 1.1.0)
33
- dm-timestamps (= 1.1.0)
34
- dm-transactions (= 1.1.0)
35
- dm-types (= 1.1.0)
36
- dm-validations (= 1.1.0)
37
- diff-lcs (1.1.2)
38
- dm-active_model (1.1.0)
39
- activemodel (~> 3.0.4)
40
- dm-core (~> 1.1.0)
41
- dm-aggregates (1.1.0)
42
- dm-core (~> 1.1.0)
43
- dm-constraints (1.1.0)
44
- dm-core (~> 1.1.0)
45
- dm-core (1.1.0)
46
- addressable (~> 2.2.4)
47
- dm-do-adapter (1.1.0)
48
- data_objects (~> 0.10.2)
49
- dm-core (~> 1.1.0)
50
- dm-migrations (1.1.0)
51
- dm-core (~> 1.1.0)
52
- dm-serializer (1.1.0)
53
- dm-core (~> 1.1.0)
29
+ datamapper (1.2.0)
30
+ dm-aggregates (~> 1.2.0)
31
+ dm-constraints (~> 1.2.0)
32
+ dm-core (~> 1.2.0)
33
+ dm-migrations (~> 1.2.0)
34
+ dm-serializer (~> 1.2.0)
35
+ dm-timestamps (~> 1.2.0)
36
+ dm-transactions (~> 1.2.0)
37
+ dm-types (~> 1.2.0)
38
+ dm-validations (~> 1.2.0)
39
+ diff-lcs (1.1.3)
40
+ dm-active_model (1.2.0)
41
+ activemodel (~> 3.1.0)
42
+ dm-core (~> 1.2.0)
43
+ dm-aggregates (1.2.0)
44
+ dm-core (~> 1.2.0)
45
+ dm-constraints (1.2.0)
46
+ dm-core (~> 1.2.0)
47
+ dm-core (1.2.0)
48
+ addressable (~> 2.2.6)
49
+ dm-do-adapter (1.2.0)
50
+ data_objects (~> 0.10.6)
51
+ dm-core (~> 1.2.0)
52
+ dm-migrations (1.2.0)
53
+ dm-core (~> 1.2.0)
54
+ dm-serializer (1.2.1)
55
+ dm-core (~> 1.2.0)
54
56
  fastercsv (~> 1.5.4)
55
- json (~> 1.4.6)
56
- dm-sqlite-adapter (1.1.0)
57
- dm-do-adapter (~> 1.1.0)
58
- do_sqlite3 (~> 0.10.2)
59
- dm-timestamps (1.1.0)
60
- dm-core (~> 1.1.0)
61
- dm-transactions (1.1.0)
62
- dm-core (~> 1.1.0)
63
- dm-types (1.1.0)
64
- bcrypt-ruby (~> 2.1.4)
65
- dm-core (~> 1.1.0)
57
+ json (~> 1.6.1)
58
+ json_pure (~> 1.6.1)
59
+ multi_json (~> 1.0.3)
60
+ dm-sqlite-adapter (1.2.0)
61
+ dm-do-adapter (~> 1.2.0)
62
+ do_sqlite3 (~> 0.10.6)
63
+ dm-timestamps (1.2.0)
64
+ dm-core (~> 1.2.0)
65
+ dm-transactions (1.2.0)
66
+ dm-core (~> 1.2.0)
67
+ dm-types (1.2.1)
68
+ bcrypt-ruby (~> 3.0.0)
69
+ dm-core (~> 1.2.0)
66
70
  fastercsv (~> 1.5.4)
67
- json (~> 1.4.6)
68
- stringex (~> 1.2.0)
71
+ json (~> 1.6.1)
72
+ multi_json (~> 1.0.3)
73
+ stringex (~> 1.3.0)
69
74
  uuidtools (~> 2.1.2)
70
- dm-validations (1.1.0)
71
- dm-core (~> 1.1.0)
72
- do_sqlite3 (0.10.5)
73
- data_objects (= 0.10.5)
75
+ dm-validations (1.2.0)
76
+ dm-core (~> 1.2.0)
77
+ do_sqlite3 (0.10.7)
78
+ data_objects (= 0.10.7)
74
79
  fastercsv (1.5.4)
75
80
  git (1.2.5)
76
- i18n (0.5.0)
77
- json (1.4.6)
78
- mongo (1.3.0)
79
- bson (>= 1.3.0)
80
- mongo_mapper (0.9.0)
81
- activemodel (~> 3.0.0)
82
- activesupport (~> 3.0.0)
83
- plucky (~> 0.3.6)
84
- mongoid (2.0.1)
81
+ i18n (0.6.0)
82
+ json (1.6.4)
83
+ json_pure (1.6.4)
84
+ mongo (1.5.2)
85
+ bson (= 1.5.2)
86
+ mongo_mapper (0.10.1)
85
87
  activemodel (~> 3.0)
88
+ activesupport (~> 3.0)
89
+ plucky (~> 0.4.0)
90
+ mongoid (2.4.0)
91
+ activemodel (~> 3.1)
86
92
  mongo (~> 1.3)
87
93
  tzinfo (~> 0.3.22)
88
- will_paginate (~> 3.0.pre)
89
- plucky (0.3.8)
94
+ multi_json (1.0.4)
95
+ plucky (0.4.3)
90
96
  mongo (~> 1.3)
91
- rake (0.8.7)
92
- rspec (2.5.0)
93
- rspec-core (~> 2.5.0)
94
- rspec-expectations (~> 2.5.0)
95
- rspec-mocks (~> 2.5.0)
96
- rspec-core (2.5.2)
97
- rspec-expectations (2.5.0)
97
+ rake (0.9.2.2)
98
+ rspec (2.8.0)
99
+ rspec-core (~> 2.8.0)
100
+ rspec-expectations (~> 2.8.0)
101
+ rspec-mocks (~> 2.8.0)
102
+ rspec-core (2.8.0)
103
+ rspec-expectations (2.8.0)
98
104
  diff-lcs (~> 1.1.2)
99
- rspec-mocks (2.5.0)
100
- sqlite3 (1.3.3)
105
+ rspec-mocks (2.8.0)
106
+ sqlite3 (1.3.5)
101
107
  sqlite3-ruby (1.3.3)
102
108
  sqlite3 (>= 1.3.3)
103
- stringex (1.2.1)
104
- tzinfo (0.3.27)
109
+ stringex (1.3.0)
110
+ tzinfo (0.3.31)
105
111
  uuidtools (2.1.2)
106
- will_paginate (3.0.pre2)
107
- yard (0.6.8)
112
+ yard (0.7.4)
108
113
 
109
114
  PLATFORMS
110
115
  ruby
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.0.6
2
+
3
+ * ActiveRecord 3.1 association compatibility [Ian White]
4
+ * Compatibility with mongoid master wrt. OrmAdapter::Base#get [Frank Wöckener]. Closes #9 [Ian White]
5
+
6
+
1
7
  == 0.0.5
2
8
 
3
9
  * Adds Mongo Mapper adapter [Luke Cunningham]
@@ -69,8 +69,15 @@ class ActiveRecord::Base
69
69
  fields = {}
70
70
  conditions.each do |key, value|
71
71
  if value.is_a?(ActiveRecord::Base) && (assoc = klass.reflect_on_association(key.to_sym)) && assoc.belongs_to?
72
- fields[assoc.primary_key_name] = value.send(value.class.primary_key)
73
- fields[assoc.options[:foreign_type]] = value.class.base_class.name.to_s if assoc.options[:polymorphic]
72
+
73
+ if ActiveRecord::VERSION::STRING < "3.1"
74
+ fields[assoc.primary_key_name] = value.send(value.class.primary_key)
75
+ fields[assoc.options[:foreign_type]] = value.class.base_class.name.to_s if assoc.options[:polymorphic]
76
+ else # >= 3.1
77
+ fields[assoc.foreign_key] = value.send(value.class.primary_key)
78
+ fields[assoc.foreign_type] = value.class.base_class.name.to_s if assoc.options[:polymorphic]
79
+ end
80
+
74
81
  else
75
82
  fields[key] = value
76
83
  end
@@ -29,7 +29,7 @@ module Mongoid
29
29
 
30
30
  # @see OrmAdapter::Base#get
31
31
  def get(id)
32
- klass.first(:conditions => { :id => wrap_key(id) })
32
+ klass.where(:_id => wrap_key(id)).first
33
33
  end
34
34
 
35
35
  # @see OrmAdapter::Base#find_first
@@ -1,3 +1,3 @@
1
1
  module OrmAdapter
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,171 +1,166 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: orm_adapter
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.6
4
5
  prerelease:
5
- version: 0.0.5
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Ian White
9
9
  - Jose Valim
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
-
14
- date: 2011-05-09 00:00:00 +01:00
15
- default_executable:
16
- dependencies:
17
- - !ruby/object:Gem::Dependency
13
+ date: 2012-01-10 00:00:00.000000000Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
18
16
  name: bundler
19
- prerelease: false
20
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &70325765408420 !ruby/object:Gem::Requirement
21
18
  none: false
22
- requirements:
23
- - - ">="
24
- - !ruby/object:Gem::Version
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
25
22
  version: 1.0.0
26
23
  type: :development
27
- version_requirements: *id001
28
- - !ruby/object:Gem::Dependency
29
- name: git
30
24
  prerelease: false
31
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *70325765408420
26
+ - !ruby/object:Gem::Dependency
27
+ name: git
28
+ requirement: &70325765407660 !ruby/object:Gem::Requirement
32
29
  none: false
33
- requirements:
34
- - - ">="
35
- - !ruby/object:Gem::Version
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
36
33
  version: 1.2.5
37
34
  type: :development
38
- version_requirements: *id002
39
- - !ruby/object:Gem::Dependency
40
- name: yard
41
35
  prerelease: false
42
- requirement: &id003 !ruby/object:Gem::Requirement
36
+ version_requirements: *70325765407660
37
+ - !ruby/object:Gem::Dependency
38
+ name: yard
39
+ requirement: &70325765407000 !ruby/object:Gem::Requirement
43
40
  none: false
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
47
44
  version: 0.6.0
48
45
  type: :development
49
- version_requirements: *id003
50
- - !ruby/object:Gem::Dependency
51
- name: rake
52
46
  prerelease: false
53
- requirement: &id004 !ruby/object:Gem::Requirement
47
+ version_requirements: *70325765407000
48
+ - !ruby/object:Gem::Dependency
49
+ name: rake
50
+ requirement: &70325765395440 !ruby/object:Gem::Requirement
54
51
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
58
55
  version: 0.8.7
59
56
  type: :development
60
- version_requirements: *id004
61
- - !ruby/object:Gem::Dependency
62
- name: activerecord
63
57
  prerelease: false
64
- requirement: &id005 !ruby/object:Gem::Requirement
58
+ version_requirements: *70325765395440
59
+ - !ruby/object:Gem::Dependency
60
+ name: activerecord
61
+ requirement: &70325765394680 !ruby/object:Gem::Requirement
65
62
  none: false
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
69
66
  version: 3.0.0
70
67
  type: :development
71
- version_requirements: *id005
72
- - !ruby/object:Gem::Dependency
73
- name: mongoid
74
68
  prerelease: false
75
- requirement: &id006 !ruby/object:Gem::Requirement
69
+ version_requirements: *70325765394680
70
+ - !ruby/object:Gem::Dependency
71
+ name: mongoid
72
+ requirement: &70325765393900 !ruby/object:Gem::Requirement
76
73
  none: false
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
80
77
  version: 2.0.0.beta.20
81
78
  type: :development
82
- version_requirements: *id006
83
- - !ruby/object:Gem::Dependency
84
- name: mongo_mapper
85
79
  prerelease: false
86
- requirement: &id007 !ruby/object:Gem::Requirement
80
+ version_requirements: *70325765393900
81
+ - !ruby/object:Gem::Dependency
82
+ name: mongo_mapper
83
+ requirement: &70325765393280 !ruby/object:Gem::Requirement
87
84
  none: false
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
91
88
  version: 0.9.0
92
89
  type: :development
93
- version_requirements: *id007
94
- - !ruby/object:Gem::Dependency
95
- name: bson_ext
96
90
  prerelease: false
97
- requirement: &id008 !ruby/object:Gem::Requirement
91
+ version_requirements: *70325765393280
92
+ - !ruby/object:Gem::Dependency
93
+ name: bson_ext
94
+ requirement: &70325765392740 !ruby/object:Gem::Requirement
98
95
  none: false
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
96
+ requirements:
97
+ - - ! '>='
98
+ - !ruby/object:Gem::Version
102
99
  version: 1.3.0
103
100
  type: :development
104
- version_requirements: *id008
105
- - !ruby/object:Gem::Dependency
106
- name: rspec
107
101
  prerelease: false
108
- requirement: &id009 !ruby/object:Gem::Requirement
102
+ version_requirements: *70325765392740
103
+ - !ruby/object:Gem::Dependency
104
+ name: rspec
105
+ requirement: &70325765391920 !ruby/object:Gem::Requirement
109
106
  none: false
110
- requirements:
111
- - - ">="
112
- - !ruby/object:Gem::Version
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
113
110
  version: 2.4.0
114
111
  type: :development
115
- version_requirements: *id009
116
- - !ruby/object:Gem::Dependency
117
- name: sqlite3-ruby
118
112
  prerelease: false
119
- requirement: &id010 !ruby/object:Gem::Requirement
113
+ version_requirements: *70325765391920
114
+ - !ruby/object:Gem::Dependency
115
+ name: sqlite3-ruby
116
+ requirement: &70325765391020 !ruby/object:Gem::Requirement
120
117
  none: false
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
118
+ requirements:
119
+ - - ! '>='
120
+ - !ruby/object:Gem::Version
124
121
  version: 1.3.2
125
122
  type: :development
126
- version_requirements: *id010
127
- - !ruby/object:Gem::Dependency
128
- name: datamapper
129
123
  prerelease: false
130
- requirement: &id011 !ruby/object:Gem::Requirement
124
+ version_requirements: *70325765391020
125
+ - !ruby/object:Gem::Dependency
126
+ name: datamapper
127
+ requirement: &70325765388180 !ruby/object:Gem::Requirement
131
128
  none: false
132
- requirements:
133
- - - ">="
134
- - !ruby/object:Gem::Version
135
- version: "1.0"
129
+ requirements:
130
+ - - ! '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '1.0'
136
133
  type: :development
137
- version_requirements: *id011
138
- - !ruby/object:Gem::Dependency
139
- name: dm-sqlite-adapter
140
134
  prerelease: false
141
- requirement: &id012 !ruby/object:Gem::Requirement
135
+ version_requirements: *70325765388180
136
+ - !ruby/object:Gem::Dependency
137
+ name: dm-sqlite-adapter
138
+ requirement: &70325765368920 !ruby/object:Gem::Requirement
142
139
  none: false
143
- requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: "1.0"
140
+ requirements:
141
+ - - ! '>='
142
+ - !ruby/object:Gem::Version
143
+ version: '1.0'
147
144
  type: :development
148
- version_requirements: *id012
149
- - !ruby/object:Gem::Dependency
150
- name: dm-active_model
151
145
  prerelease: false
152
- requirement: &id013 !ruby/object:Gem::Requirement
146
+ version_requirements: *70325765368920
147
+ - !ruby/object:Gem::Dependency
148
+ name: dm-active_model
149
+ requirement: &70325765367400 !ruby/object:Gem::Requirement
153
150
  none: false
154
- requirements:
155
- - - ">="
156
- - !ruby/object:Gem::Version
157
- version: "1.0"
151
+ requirements:
152
+ - - ! '>='
153
+ - !ruby/object:Gem::Version
154
+ version: '1.0'
158
155
  type: :development
159
- version_requirements: *id013
156
+ prerelease: false
157
+ version_requirements: *70325765367400
160
158
  description: Provides a single point of entry for using basic features of ruby ORMs
161
159
  email: ian.w.white@gmail.com
162
160
  executables: []
163
-
164
161
  extensions: []
165
-
166
162
  extra_rdoc_files: []
167
-
168
- files:
163
+ files:
169
164
  - .gitignore
170
165
  - Gemfile
171
166
  - Gemfile.lock.development
@@ -190,35 +185,33 @@ files:
190
185
  - spec/orm_adapter/example_app_shared.rb
191
186
  - spec/orm_adapter_spec.rb
192
187
  - spec/spec_helper.rb
193
- has_rdoc: true
194
188
  homepage: http://github.com/ianwhite/orm_adapter
195
189
  licenses: []
196
-
197
190
  post_install_message:
198
191
  rdoc_options: []
199
-
200
- require_paths:
192
+ require_paths:
201
193
  - lib
202
- required_ruby_version: !ruby/object:Gem::Requirement
194
+ required_ruby_version: !ruby/object:Gem::Requirement
203
195
  none: false
204
- requirements:
205
- - - ">="
206
- - !ruby/object:Gem::Version
207
- version: "0"
208
- required_rubygems_version: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - ! '>='
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ required_rubygems_version: !ruby/object:Gem::Requirement
209
201
  none: false
210
- requirements:
211
- - - ">="
212
- - !ruby/object:Gem::Version
202
+ requirements:
203
+ - - ! '>='
204
+ - !ruby/object:Gem::Version
213
205
  version: 1.3.6
214
206
  requirements: []
215
-
216
207
  rubyforge_project: orm_adapter
217
- rubygems_version: 1.5.1
208
+ rubygems_version: 1.8.10
218
209
  signing_key:
219
210
  specification_version: 3
220
- summary: orm_adapter provides a single point of entry for using basic features of popular ruby ORMs. Its target audience is gem authors who want to support many ruby ORMs.
221
- test_files:
211
+ summary: orm_adapter provides a single point of entry for using basic features of
212
+ popular ruby ORMs. Its target audience is gem authors who want to support many
213
+ ruby ORMs.
214
+ test_files:
222
215
  - spec/orm_adapter/adapters/active_record_spec.rb
223
216
  - spec/orm_adapter/adapters/data_mapper_spec.rb
224
217
  - spec/orm_adapter/adapters/mongo_mapper_spec.rb
@@ -227,3 +220,4 @@ test_files:
227
220
  - spec/orm_adapter/example_app_shared.rb
228
221
  - spec/orm_adapter_spec.rb
229
222
  - spec/spec_helper.rb
223
+ has_rdoc: