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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e348dc0ae701c8da46874976c5b32563bb5e3016
4
- data.tar.gz: ce8cb95db0f96025242aedc2edc898fb0763372e
3
+ metadata.gz: fb6147e53bf5b8b125cb237a5eaa5345f75391f4
4
+ data.tar.gz: 378a53e4425a375587dcce8c16a0e6f660f6d248
5
5
  SHA512:
6
- metadata.gz: 3858bf69ee794b819aaa0acfc8e303002e618ca9eb5dcdb2f0bae7a8097612b639e83d4dbb7604d67b5de86d8416fffc372e23e80afd5697cdb2e05d6f5266d4
7
- data.tar.gz: 4d5e536cbc8ca2a279148568ae658acf39a5cba8a9e87f20dade9279104c7f9db3747d09d77c58127166c14e97a4f7bdaf4b62928fb9dc0566c38b06889bb67e
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
@@ -286,8 +286,7 @@ keys:
286
286
  # Many relationships lets you do:
287
287
  # Model.parents.all or model.parents.featured.all with scopes
288
288
  many:
289
- models:
290
- dependent: destroy
289
+ - models
291
290
  ```
292
291
 
293
292
 
@@ -21,6 +21,8 @@ keys:
21
21
  write: user
22
22
  tags:
23
23
  - badge
24
+ auth:
25
+ desc: Model auth
24
26
  duration:
25
27
  desc: Model duration in days
26
28
  type: integer
@@ -37,5 +37,4 @@ keys:
37
37
  write: dev
38
38
 
39
39
  many:
40
- models:
41
- dependent: destroy
40
+ - models
@@ -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
@@ -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] || {}).each{|k, v| many(k, v)}
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, data)
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
@@ -7,7 +7,7 @@ require 'mongo'
7
7
  require 'request_store'
8
8
 
9
9
  module Mongocore
10
- VERSION = '0.2.5'
10
+ VERSION = '0.3.0'
11
11
 
12
12
  # # # # # #
13
13
  # Mongocore Ruby Database Driver.
data/mongocore.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'mongocore'
3
- s.version = '0.2.5'
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."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongocore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fugroup Limited