mongocore 0.3.1 → 0.3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/mongocore/document.rb +2 -2
- data/lib/mongocore/schema.rb +1 -1
- data/lib/mongocore.rb +1 -1
- data/mongocore.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0d675c271e8b08722c8c8718eff9c47a0a063a2
|
4
|
+
data.tar.gz: d9d09c93594c0753aebb8828d701af09fae02622
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '038870dd3510025c0542a87bf6772b164b7069647c33f557818640c0eacdf3b9fa76e7b17db1e8edcbff73a68d492b209e737e8f223a767499d3fc47d15ca367'
|
7
|
+
data.tar.gz: 7a8081b233a7ccd57a614e454246019b5bc68dea029d5b78557d03f2e74614b177d9f98f0d34713ac70a8fb460bc1d34f4c3b7290554a5380301653f7f00b1f2
|
data/README.md
CHANGED
@@ -15,13 +15,13 @@ With Mongocore you can do:
|
|
15
15
|
|
16
16
|
The schema is specified with a YAML file which supports default values, data types, and security levels for each key.
|
17
17
|
|
18
|
-
Please read [the source code](https://github.com/fugroup/mongocore/tree/master/lib/mongocore) to see how it works, it's fully commented and very small, only 8 files, and
|
18
|
+
Please read [the source code](https://github.com/fugroup/mongocore/tree/master/lib/mongocore) to see how it works, it's fully commented and very small, only 8 files, and 450 lines of fully test driven code.
|
19
19
|
|
20
20
|
| Library | Files | Comment | Lines of code |
|
21
21
|
| -------------------------------------- | ----- | ------- | ------------- |
|
22
22
|
| [Mongoid](http://mongoid.com) | 256 | 14371 | 10590 |
|
23
23
|
| [MongoMapper](http://mongomapper.com) | 91 | 200 | 4070 |
|
24
|
-
| [Mongocore](http://mongocore.com) | 8 |
|
24
|
+
| [Mongocore](http://mongocore.com) | 8 | 260 | 450 |
|
25
25
|
|
26
26
|
<br>
|
27
27
|
|
data/lib/mongocore/document.rb
CHANGED
@@ -169,7 +169,7 @@ module Mongocore
|
|
169
169
|
|
170
170
|
# Get attribute if access
|
171
171
|
def read(key)
|
172
|
-
self.class.access.read?(key) ? read!(key) : nil
|
172
|
+
self.class.access.read?((key = key.to_sym)) ? read!(key) : nil
|
173
173
|
end
|
174
174
|
|
175
175
|
# Get attribute
|
@@ -179,7 +179,7 @@ module Mongocore
|
|
179
179
|
|
180
180
|
# Set attribute if access
|
181
181
|
def write(key, val)
|
182
|
-
return nil unless self.class.access.write?(key)
|
182
|
+
return nil unless self.class.access.write?((key = key.to_sym))
|
183
183
|
|
184
184
|
# Convert to type as in schema yml
|
185
185
|
v = self.class.schema.convert(key, val)
|
data/lib/mongocore/schema.rb
CHANGED
data/lib/mongocore.rb
CHANGED
data/mongocore.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'mongocore'
|
3
|
-
s.version = '0.3.1'
|
3
|
+
s.version = '0.3.1.1'
|
4
4
|
s.date = '2017-11-25'
|
5
5
|
s.summary = "MongoDB ORM implementation on top of the Ruby MongoDB driver"
|
6
6
|
s.description = "Does validations, associations, scopes, filters, pagination, counter cache, request cache, and nested queries. Using a YAML schema file, which supports default values, data types, and security levels for each key."
|