mongocore 0.2.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -2
- data/config/db/schema/model.yml +2 -0
- data/config/db/schema/parent.yml +1 -2
- data/lib/mongocore/access.rb +3 -3
- data/lib/mongocore/schema.rb +2 -2
- 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: fb6147e53bf5b8b125cb237a5eaa5345f75391f4
|
4
|
+
data.tar.gz: 378a53e4425a375587dcce8c16a0e6f660f6d248
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e438ad2a1d641ee29777e116dec35187f8a113e1fd4233eba36cb6ac3ce924f6d1a877673ada4762000b0a20a4addb2ddc6d7774fd89df2f5ec90a7727fb497e
|
7
|
+
data.tar.gz: 8c29834f2ec9975eec10f65beeda434fd8a9d7d141ab08bda548ce82e7768d40577205348e11541065cba1ebd52892a15eec199ac9882d54bad3da831835114e
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
+
**Version 0.3.0** - *2017-10-30*
|
2
|
+
|
3
|
+
- Removed support for dependent destroy
|
4
|
+
|
5
|
+
|
1
6
|
**Version 0.1.0** - *2017-01-06*
|
2
7
|
|
3
8
|
- Fixed gemspec issues
|
4
9
|
|
10
|
+
|
5
11
|
**Version 0.1.0** - *2017-01-05*
|
6
12
|
|
7
13
|
- Automatic saving of created_at and updated_at keys if they exist
|
data/README.md
CHANGED
data/config/db/schema/model.yml
CHANGED
data/config/db/schema/parent.yml
CHANGED
data/lib/mongocore/access.rb
CHANGED
@@ -24,12 +24,12 @@ module Mongocore
|
|
24
24
|
|
25
25
|
# Key readable?
|
26
26
|
def read?(key)
|
27
|
-
ok?(keys[key][:read]) rescue false
|
27
|
+
ok?(keys[key][:read] || :all) rescue false
|
28
28
|
end
|
29
29
|
|
30
30
|
# Key writable?
|
31
31
|
def write?(key)
|
32
|
-
ok?(keys[key][:write]) rescue false
|
32
|
+
ok?(keys[key][:write] || :all) rescue false
|
33
33
|
end
|
34
34
|
|
35
35
|
# Ok?
|
@@ -63,7 +63,7 @@ module Mongocore
|
|
63
63
|
end
|
64
64
|
|
65
65
|
# Access block
|
66
|
-
# Run with Mongocore::Access(:user){ # Do something as :user}
|
66
|
+
# Run with Mongocore::Access.role(:user){ # Do something as :user}
|
67
67
|
def self.role(level, &block)
|
68
68
|
set(level); yield.tap{ set(nil)}
|
69
69
|
end
|
data/lib/mongocore/schema.rb
CHANGED
@@ -29,7 +29,7 @@ module Mongocore
|
|
29
29
|
(@accessors = @schema[:accessor] || []).each{|a| @klass.send(:attr_accessor, a)}
|
30
30
|
|
31
31
|
# Many
|
32
|
-
(@many = @schema[:many] ||
|
32
|
+
(@many = @schema[:many] || []).each{|k| many(k)}
|
33
33
|
|
34
34
|
# Scopes
|
35
35
|
(@scopes = @schema[:scopes] || {}).each{|k, v| scope(k, v)}
|
@@ -112,7 +112,7 @@ module Mongocore
|
|
112
112
|
end
|
113
113
|
|
114
114
|
# Many
|
115
|
-
def many(key
|
115
|
+
def many(key)
|
116
116
|
t = %Q{
|
117
117
|
def #{key}
|
118
118
|
mq(#{key.to_s.singularize.capitalize}, {:#{@klass.to_s.downcase}_id => @_id}, {}, :source => self)
|
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
|
+
s.version = '0.3.0'
|
4
4
|
s.date = '2017-10-30'
|
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."
|