mongoid-cached-json 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mongoid-cached-json/cached_json.rb +5 -2
- data/lib/mongoid-cached-json/version.rb +1 -2
- metadata +126 -128
@@ -105,13 +105,16 @@ module Mongoid
|
|
105
105
|
reference_json = nil
|
106
106
|
if reference_def[:metadata]
|
107
107
|
key = reference_def[:metadata].key.to_sym
|
108
|
-
if reference_def[:metadata].
|
108
|
+
if reference_def[:metadata].polymorphic?
|
109
|
+
clazz = reference_def[:metadata].inverse_class_name.constantize
|
110
|
+
else
|
109
111
|
clazz = reference_def[:metadata].class_name.constantize
|
112
|
+
end
|
113
|
+
if reference_def[:metadata].relation == Mongoid::Relations::Referenced::ManyToMany
|
110
114
|
reference_json = object.send(key).map do |id|
|
111
115
|
materialize_json(options, { :clazz => clazz, :id => id })
|
112
116
|
end.compact
|
113
117
|
elsif reference_def[:metadata].relation == Mongoid::Relations::Referenced::In
|
114
|
-
clazz = reference_def[:metadata].inverse_class_name.constantize
|
115
118
|
reference_json = materialize_json(options, { :clazz => clazz, :id => object.send(key) })
|
116
119
|
end
|
117
120
|
end
|
metadata
CHANGED
@@ -1,150 +1,154 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-cached-json
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.3
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 2
|
9
|
-
- 2
|
10
|
-
version: 1.2.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Aaron Windsor
|
14
9
|
- Daniel Doubrovkine
|
15
10
|
- Frank Macreery
|
16
11
|
autorequire:
|
17
12
|
bindir: bin
|
18
13
|
cert_chain: []
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
- !ruby/object:Gem::Dependency
|
23
|
-
type: :runtime
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
version: "0"
|
33
|
-
prerelease: false
|
14
|
+
date: 2012-07-04 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
34
17
|
name: activesupport
|
35
|
-
|
36
|
-
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ! '>='
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '0'
|
37
24
|
type: :runtime
|
38
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
hash: 3
|
44
|
-
segments:
|
45
|
-
- 0
|
46
|
-
version: "0"
|
47
25
|
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ! '>='
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: '0'
|
32
|
+
- !ruby/object:Gem::Dependency
|
48
33
|
name: mongoid
|
49
|
-
|
50
|
-
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
51
40
|
type: :runtime
|
52
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
-
none: false
|
54
|
-
requirements:
|
55
|
-
- - ">="
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
hash: 3
|
58
|
-
segments:
|
59
|
-
- 0
|
60
|
-
version: "0"
|
61
41
|
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
- !ruby/object:Gem::Dependency
|
62
49
|
name: bson_ext
|
63
|
-
|
64
|
-
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
65
56
|
type: :runtime
|
66
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
67
|
-
none: false
|
68
|
-
requirements:
|
69
|
-
- - ">="
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
hash: 3
|
72
|
-
segments:
|
73
|
-
- 0
|
74
|
-
version: "0"
|
75
57
|
prerelease: false
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
- !ruby/object:Gem::Dependency
|
76
65
|
name: hpricot
|
77
|
-
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
type: :development
|
80
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
66
|
+
requirement: !ruby/object:Gem::Requirement
|
81
67
|
none: false
|
82
|
-
requirements:
|
83
|
-
- -
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
|
86
|
-
|
87
|
-
- 2
|
88
|
-
- 5
|
89
|
-
version: "2.5"
|
68
|
+
requirements:
|
69
|
+
- - ! '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
type: :runtime
|
90
73
|
prerelease: false
|
74
|
+
version_requirements: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
- !ruby/object:Gem::Dependency
|
91
81
|
name: rspec
|
92
|
-
|
93
|
-
- !ruby/object:Gem::Dependency
|
94
|
-
type: :development
|
95
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
96
83
|
none: false
|
97
|
-
requirements:
|
84
|
+
requirements:
|
98
85
|
- - ~>
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
|
101
|
-
|
102
|
-
- 1
|
103
|
-
- 0
|
104
|
-
version: "1.0"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '2.5'
|
88
|
+
type: :development
|
105
89
|
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ~>
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '2.5'
|
96
|
+
- !ruby/object:Gem::Dependency
|
106
97
|
name: bundler
|
107
|
-
|
108
|
-
- !ruby/object:Gem::Dependency
|
109
|
-
type: :development
|
110
|
-
requirement: &id007 !ruby/object:Gem::Requirement
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
111
99
|
none: false
|
112
|
-
requirements:
|
100
|
+
requirements:
|
113
101
|
- - ~>
|
114
|
-
- !ruby/object:Gem::Version
|
115
|
-
|
116
|
-
|
117
|
-
- 1
|
118
|
-
- 6
|
119
|
-
version: "1.6"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.0'
|
104
|
+
type: :development
|
120
105
|
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ~>
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '1.0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
121
113
|
name: jeweler
|
122
|
-
|
123
|
-
- !ruby/object:Gem::Dependency
|
124
|
-
type: :development
|
125
|
-
requirement: &id008 !ruby/object:Gem::Requirement
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
126
115
|
none: false
|
127
|
-
requirements:
|
116
|
+
requirements:
|
128
117
|
- - ~>
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
|
131
|
-
|
132
|
-
- 0
|
133
|
-
- 6
|
134
|
-
version: "0.6"
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '1.6'
|
120
|
+
type: :development
|
135
121
|
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
124
|
+
requirements:
|
125
|
+
- - ~>
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '1.6'
|
128
|
+
- !ruby/object:Gem::Dependency
|
136
129
|
name: yard
|
137
|
-
|
130
|
+
requirement: !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
132
|
+
requirements:
|
133
|
+
- - ~>
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0.6'
|
136
|
+
type: :development
|
137
|
+
prerelease: false
|
138
|
+
version_requirements: !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
140
|
+
requirements:
|
141
|
+
- - ~>
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0.6'
|
138
144
|
description: Cached-json is a DSL for describing JSON representations of Mongoid models.
|
139
145
|
email: dblock@dblock.org
|
140
146
|
executables: []
|
141
|
-
|
142
147
|
extensions: []
|
143
|
-
|
144
|
-
extra_rdoc_files:
|
148
|
+
extra_rdoc_files:
|
145
149
|
- LICENSE.md
|
146
150
|
- README.md
|
147
|
-
files:
|
151
|
+
files:
|
148
152
|
- lib/mongoid-cached-json.rb
|
149
153
|
- lib/mongoid-cached-json/cached_json.rb
|
150
154
|
- lib/mongoid-cached-json/config.rb
|
@@ -152,37 +156,31 @@ files:
|
|
152
156
|
- LICENSE.md
|
153
157
|
- README.md
|
154
158
|
homepage: http://github.com/dblock/mongoid-cached-json
|
155
|
-
licenses:
|
159
|
+
licenses:
|
156
160
|
- MIT
|
157
161
|
post_install_message:
|
158
162
|
rdoc_options: []
|
159
|
-
|
160
|
-
require_paths:
|
163
|
+
require_paths:
|
161
164
|
- lib
|
162
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
165
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
163
166
|
none: false
|
164
|
-
requirements:
|
165
|
-
- -
|
166
|
-
- !ruby/object:Gem::Version
|
167
|
-
|
168
|
-
segments:
|
167
|
+
requirements:
|
168
|
+
- - ! '>='
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: '0'
|
171
|
+
segments:
|
169
172
|
- 0
|
170
|
-
|
171
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
|
+
hash: -1020495875
|
174
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
175
|
none: false
|
173
|
-
requirements:
|
174
|
-
- -
|
175
|
-
- !ruby/object:Gem::Version
|
176
|
-
|
177
|
-
segments:
|
178
|
-
- 0
|
179
|
-
version: "0"
|
176
|
+
requirements:
|
177
|
+
- - ! '>='
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0'
|
180
180
|
requirements: []
|
181
|
-
|
182
181
|
rubyforge_project:
|
183
|
-
rubygems_version: 1.8.
|
182
|
+
rubygems_version: 1.8.24
|
184
183
|
signing_key:
|
185
184
|
specification_version: 3
|
186
185
|
summary: Effective model-level JSON caching for the Mongoid ODM.
|
187
186
|
test_files: []
|
188
|
-
|