regressor 0.5.2 → 0.5.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: 79c37f1dc82def55a51fbe5361c67c796bc323cf
4
- data.tar.gz: 040a75add8d05a52af41705277be79aeec404d79
3
+ metadata.gz: 1e1fd6866630480c84a4707e3d9e096b31aff611
4
+ data.tar.gz: 4223204e6698a858f87c3bfdc246f2cdbf994cfb
5
5
  SHA512:
6
- metadata.gz: e756cccd3dccfdb1e0b96a7250d4c6eb2a70099934b517bb57b9d12b9bd3a50265c4452a7cd0da06c9e5f6992e9a597206c8f08a26f5e924c1858477477f3bd2
7
- data.tar.gz: f6242b1742094db9396cfebf04cccb24a740237475e4a149ed766c2aada3b27c944b4521501120c0c6273e8aae368bd05d5a2aaee641fe3cfb27a4032f5519e7
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Regressor
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
@@ -3,6 +3,7 @@ require 'rails_helper'
3
3
  RSpec.describe <%= @model.model %>, regressor: true do
4
4
  # === Document ===
5
5
  <%= @model.timestamp_includes %>
6
+ <%= @model.version_include %>
6
7
 
7
8
  # === Relations ===
8
9
  <%= @model.belongs_to_relations %>
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.2
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