embedded_record 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/embedded_record.rb +7 -10
- data/test/embedded_record_test.rb +1 -0
- metadata +5 -5
data/README.md
CHANGED
data/lib/embedded_record.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module EmbeddedRecord
|
2
|
-
VERSION = "0.0.
|
2
|
+
VERSION = "0.0.5"
|
3
3
|
|
4
4
|
def self.included(klass)
|
5
5
|
klass.extend self
|
@@ -161,7 +161,7 @@ module EmbeddedRecord::Record
|
|
161
161
|
##
|
162
162
|
# Returns Array of records ids
|
163
163
|
def ids
|
164
|
-
|
164
|
+
@keys ||= []
|
165
165
|
end
|
166
166
|
|
167
167
|
##
|
@@ -173,7 +173,7 @@ module EmbeddedRecord::Record
|
|
173
173
|
##
|
174
174
|
# Returns all records
|
175
175
|
def all
|
176
|
-
records
|
176
|
+
@records ||= []
|
177
177
|
end
|
178
178
|
|
179
179
|
##
|
@@ -202,9 +202,12 @@ module EmbeddedRecord::Record
|
|
202
202
|
end
|
203
203
|
|
204
204
|
if id == nil
|
205
|
+
def record.nil?; true end
|
206
|
+
|
205
207
|
@null_record = record
|
206
208
|
else
|
207
|
-
|
209
|
+
ids << id
|
210
|
+
all << record
|
208
211
|
end
|
209
212
|
end
|
210
213
|
|
@@ -231,11 +234,5 @@ module EmbeddedRecord::Record
|
|
231
234
|
attr_accessor name
|
232
235
|
end
|
233
236
|
end
|
234
|
-
|
235
|
-
private
|
236
|
-
|
237
|
-
def records
|
238
|
-
@records ||= {}
|
239
|
-
end
|
240
237
|
end
|
241
238
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embedded_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-11-07 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &70131602869220 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70131602869220
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: minitest
|
27
|
-
requirement: &
|
27
|
+
requirement: &70131602868440 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '2.6'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70131602868440
|
36
36
|
description:
|
37
37
|
email:
|
38
38
|
- wojtek@wojtekmach.pl
|