mongocore 0.1.2 → 0.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55808be92e72f178a15d79162ce306e93697af46
4
- data.tar.gz: 616b1fa1123ee89dae66153e1b5702679a829310
3
+ metadata.gz: 1632e0446a4711953c509726122f1c51538e5c71
4
+ data.tar.gz: 610443c8728e6641559c819134ceb50d78499c4d
5
5
  SHA512:
6
- metadata.gz: c3ca71c855ad06198b6d4d05c8a5abf8816868c53d649caeeb81b9063f72657ce70f6e773d4c7d4a171a06c291279d1524e1153376ba3670f841e748c23eb91b
7
- data.tar.gz: e33647c2848cc8d04dc6db9db061c2009637e6e1714c7a74996744efd2ad64e62a60feda4d1137d4f5257a0e7c033c9a79e43a9938df11fcafc43de86d33eea5
6
+ metadata.gz: 38a33cbffc7ccd7e6322f7ee17bdc4df74bd78e655259a57b60626c0385b52c7ce425d9f8d57c7c1684d4aa1682d9f1c485fcbe792bc8bd5f472ac0a8760a4bf
7
+ data.tar.gz: 22bcda0691d064dbc99f2f1b029193a7aae015bf0cd63882139a4cd320338990f26f7a00234e59ded41b039800e45129ef99de7b68326027c0b316e5f3dde36b
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 7 files, and 354 lines of fully test driven code.
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 360 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 | 224 | 354 |
24
+ | [Mongocore](http://mongocore.com) | 8 | 230 | 360 |
25
25
 
26
26
  <br>
27
27
 
@@ -131,6 +131,9 @@ m = p.models.last
131
131
  c = Model.count
132
132
  c = p.models.featured.count
133
133
 
134
+ # Skip
135
+ m = Model.find.skip(2).first
136
+
134
137
  # Tagged keys for attributes and to_json
135
138
  m = Model.first
136
139
  m.attributes # => All attributes
@@ -28,7 +28,7 @@ module Mongocore
28
28
  @model = m
29
29
 
30
30
  # The model name is singular, the collection name is plural
31
- @colname = "#{m.to_s.downcase}s".to_sym
31
+ @colname = m.to_s.downcase.pluralize.to_sym
32
32
 
33
33
  # Storing the Mongo::Collection object
34
34
  @collection = Mongocore.db[@colname]
@@ -64,7 +64,7 @@ module Mongocore
64
64
 
65
65
  # Delete
66
66
  def delete
67
- @collection.delete_one(@query)
67
+ @collection.delete_one(@query).ok?
68
68
  end
69
69
 
70
70
  # Count. Returns the number of documents as an integer
data/lib/mongocore.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'active_support'
2
2
  require 'active_support/core_ext'
3
+ require 'active_support/inflector'
3
4
  require 'yaml'
4
5
  require 'json'
5
6
  require 'mongo'
data/mongocore.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'mongocore'
3
- s.version = '0.1.2'
4
- s.date = '2017-10-11'
3
+ s.version = '0.1.3'
4
+ s.date = '2017-10-15'
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."
7
7
  s.authors = ["Fugroup Limited"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongocore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fugroup Limited
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-11 00:00:00.000000000 Z
11
+ date: 2017-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongo