mongo_mapper 0.16.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -15
- data/lib/mongo_mapper/plugins/serialization.rb +1 -1
- data/lib/mongo_mapper/plugins/stats.rb +5 -2
- data/lib/mongo_mapper/version.rb +1 -1
- data/spec/examples.txt +1727 -1726
- data/spec/functional/stats_spec.rb +6 -0
- data/spec/unit/extensions_spec.rb +6 -1
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74ec9f278a24ea6d1a430b798204b50f2e69e96f5d01d3cd564a4a582b3683c8
|
4
|
+
data.tar.gz: d803b9283fcef845d9d841d2d93dba96084bdeb55c316b0f9350e304e2fbe809
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e58932d6d99c84dd711aaac5162fa4ac7e6fd518e187f9c544e2498fb215aa3ab21f6f70e27abfddb312a594c0ec115a217eede15772202a8e6c24b6b51dc051
|
7
|
+
data.tar.gz: 23f13767289d092fb1aad74fb4dc18d92a573b42fd4bf938b426ea15fcfdc317de252c6100a3687a11e7edce855bfa13a10e3e956e2e2eb182314208182b0351
|
data/README.md
CHANGED
@@ -30,14 +30,15 @@ work some more on the project, send an email to Scott Taylor
|
|
30
30
|
|
31
31
|
MongoMapper is tested against:
|
32
32
|
|
33
|
-
|
34
|
-
|
33
|
+
- MRI 2.4 - 3.2
|
34
|
+
- JRuby (Versions with 3.1 compatibility)
|
35
35
|
|
36
36
|
Additionally, MongoMapper is tested against:
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
- Rails 5.0 - 5.2
|
39
|
+
- Rails 6.0 - 6.1
|
40
|
+
- Rails 7.0 - 7.2
|
41
|
+
- Rails 8.0
|
41
42
|
|
42
43
|
Note, if you are using Ruby 3.0+, you'll need Rails 6.0+.
|
43
44
|
|
@@ -47,11 +48,11 @@ Note, if you are using Ruby 3.0+, you'll need Rails 6.0+.
|
|
47
48
|
$ bundle install
|
48
49
|
$ bundle exec rake
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
- Fork the project.
|
52
|
+
- Make your feature addition or bug fix. All specs should pass.
|
53
|
+
- Add specs for your changes. This is important so that it doesn't break in a future version.
|
54
|
+
- Commit, do not mess with Rakefile, version, or history. If you want to have your own version, that is fine but bump version in a commit by itself in another branch so a maintainer can ignore it when your pull request is merged.
|
55
|
+
- Send a pull request. Bonus points for topic branches.
|
55
56
|
|
56
57
|
## How to release
|
57
58
|
|
@@ -63,15 +64,15 @@ Hit up the Google group: http://groups.google.com/group/mongomapper
|
|
63
64
|
|
64
65
|
## Copyright
|
65
66
|
|
66
|
-
Copyright (c) 2009-
|
67
|
+
Copyright (c) 2009-2023 MongoMapper. See LICENSE for details.
|
67
68
|
|
68
69
|
## Contributors
|
69
70
|
|
70
71
|
MongoMapper/Plucky is:
|
71
72
|
|
72
|
-
|
73
|
-
|
74
|
-
|
73
|
+
- John Nunemaker
|
74
|
+
- Chris Heald
|
75
|
+
- Scott Taylor
|
75
76
|
|
76
77
|
But all open source projects are a team effort and could not happen without
|
77
|
-
everyone who has contributed.
|
78
|
+
everyone who has contributed. See `CONTRIBUTORS` for the full list. Thank you!
|
@@ -18,7 +18,7 @@ module MongoMapper
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def serializable_hash(options = nil)
|
21
|
-
options
|
21
|
+
options = options ? options.dup : {}
|
22
22
|
|
23
23
|
options[:only] = Array.wrap(options[:only]).map { |k| k.to_s }
|
24
24
|
options[:except] = Array.wrap(options[:except]).map { |k| k.to_s }
|
@@ -5,8 +5,11 @@ module MongoMapper
|
|
5
5
|
module Stats
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
module ClassMethods
|
8
|
-
def stats
|
9
|
-
|
8
|
+
def stats(scale: nil)
|
9
|
+
query = { :collstats => collection.name }
|
10
|
+
query[:scale] = scale if scale
|
11
|
+
|
12
|
+
stats = database.command(query).documents[0]
|
10
13
|
Struct.new(*stats.keys.collect { |key| key.underscore.to_sym }).new(*stats.values)
|
11
14
|
rescue
|
12
15
|
nil
|
data/lib/mongo_mapper/version.rb
CHANGED