regressor 0.5.2 → 0.5.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e1fd6866630480c84a4707e3d9e096b31aff611
|
4
|
+
data.tar.gz: 4223204e6698a858f87c3bfdc246f2cdbf994cfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a81baa0f5046c9658249df52d675b257f879008caa33d5c280ae656fac92adc1722fb4c88ce9231a94293888d91f0915d63ee5d000de04b80ea4a9cc471df012
|
7
|
+
data.tar.gz: a6a45e5c863dd3aba5a47b3bfd5ed7b3be7bbf852aa0d00a02c929b8580354b286f810703aad50dc9aef68c938f164abc24856782dd8b22643d3951e0eb4208f
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Regressor
|
2
|
+
module Model
|
3
|
+
module Mongoid
|
4
|
+
module Document
|
5
|
+
module Version
|
6
|
+
def version_include
|
7
|
+
if versioning_included?
|
8
|
+
"it { is_expected.to be_versioned_document }"
|
9
|
+
else
|
10
|
+
"it { is_expected.not_to be_versioned_document }"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def versioning_included?
|
17
|
+
@model.included_modules.map(&:to_s).include? 'Mongoid::Versioning'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/model/mongoid_model.rb
CHANGED
@@ -4,6 +4,7 @@ require 'model/mongoid/relation/has_one'
|
|
4
4
|
require 'model/mongoid/relation/belongs_to'
|
5
5
|
require 'model/mongoid/relation/embedded'
|
6
6
|
require 'model/mongoid/document/timestamp'
|
7
|
+
require 'model/mongoid/document/version'
|
7
8
|
|
8
9
|
module Regressor
|
9
10
|
module Model
|
@@ -15,6 +16,7 @@ module Regressor
|
|
15
16
|
include Mongoid::Relation::BelongsTo
|
16
17
|
include Mongoid::Relation::Embedded
|
17
18
|
include Mongoid::Document::Timestamp
|
19
|
+
include Mongoid::Document::Version
|
18
20
|
|
19
21
|
# === Attribute Accessors ===
|
20
22
|
attr_accessor :model
|
data/lib/regressor/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: regressor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erwin Schens
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- lib/model/active_record_model.rb
|
157
157
|
- lib/model/mongoid/database/field.rb
|
158
158
|
- lib/model/mongoid/document/timestamp.rb
|
159
|
+
- lib/model/mongoid/document/version.rb
|
159
160
|
- lib/model/mongoid/relation/belongs_to.rb
|
160
161
|
- lib/model/mongoid/relation/embedded.rb
|
161
162
|
- lib/model/mongoid/relation/has_many.rb
|