structure 0.15.0 → 0.15.1
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/lib/structure/static.rb +3 -3
- data/lib/structure/version.rb +1 -1
- metadata +2 -2
data/lib/structure/static.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
class Structure
|
7
7
|
module Static
|
8
8
|
def self.included(base)
|
9
|
-
base.key(:
|
9
|
+
base.key(:_id, Integer)
|
10
10
|
base.extend(ClassMethods)
|
11
11
|
end
|
12
12
|
|
@@ -23,7 +23,7 @@ class Structure
|
|
23
23
|
# Returns all records.
|
24
24
|
def all
|
25
25
|
@records ||= data.map do |record|
|
26
|
-
record["
|
26
|
+
record["_id"] ||= record.delete("id") || increment_id
|
27
27
|
new(record)
|
28
28
|
end
|
29
29
|
end
|
@@ -38,7 +38,7 @@ class Structure
|
|
38
38
|
|
39
39
|
# Finds a record by its ID.
|
40
40
|
def find(id)
|
41
|
-
detect { |record| record.
|
41
|
+
detect { |record| record._id == id }
|
42
42
|
end
|
43
43
|
|
44
44
|
# Sets the path for the data file.
|
data/lib/structure/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: structure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -49,7 +49,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
49
49
|
version: '0'
|
50
50
|
segments:
|
51
51
|
- 0
|
52
|
-
hash:
|
52
|
+
hash: 2919723217978587663
|
53
53
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
54
|
none: false
|
55
55
|
requirements:
|