glebtv_mongoid_userstamp 0.9.1 → 0.10.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
  SHA256:
3
- metadata.gz: ec66d169aaec0ddf4865952f5ec28f7f0e2f22b325bbf7941abd9bc21d02e99d
4
- data.tar.gz: 7c164ab473f37429865ff71cf57c252202cc5ee678588dd4d5c948d89d966872
3
+ metadata.gz: 77649687478def5c2d3b302346acb4aaea31d765a1b67556a0a509f918ef45ab
4
+ data.tar.gz: be8a0be3f6870fbea333d90c03501be64c4a0839c34a172a7e2749832da41ca4
5
5
  SHA512:
6
- metadata.gz: 9fe43db88f70dbb4ea18ea54d5abb3e61e0aaacf4f811b663fe2519cb20ca342e8f55c5da9011f7dd3c3ea4a888b555f79bd6164ceb07c58c8b245087cf9ee1b
7
- data.tar.gz: 11178e22482adea865b35d509e3570ca99fc921e418005059ca28e077243191a38641412327195baec360cf0ef623de4b8fc0f646b8d7fb95530b8453078d455
6
+ metadata.gz: aa8911e23c3115c20b1c83054bc6ea0b68703b8f66b1870abd936f3e267d3dd5b3e437b8928ed9de01b65755543cbd3557eaf7ec45e1701dc5391b6a65684088
7
+ data.tar.gz: b07e80c7a13454f9eb5239074e5dbd2e785a81500d9cde28e23745a8cd294672e121b852649fff7bd0c627ca6ae1bdcb0e7ff28717e265218c5f539d49130a95
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Userstamp
3
- VERSION = '0.9.1'
3
+ VERSION = '0.10.0'
4
4
  end
5
5
  end
@@ -3,8 +3,8 @@ module Mongoid
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- belongs_to Userstamp.config.creator_field, class_name: Userstamp.config.user_model_name, autosave: false, required: false
7
- belongs_to Userstamp.config.updater_field, class_name: Userstamp.config.user_model_name, autosave: false, required: false
6
+ belongs_to Userstamp.config.creator_field, class_name: Userstamp.config.user_model_name, autosave: false, optional: true
7
+ belongs_to Userstamp.config.updater_field, class_name: Userstamp.config.user_model_name, autosave: false, optional: true
8
8
 
9
9
  before_validation :set_updater
10
10
  before_validation :set_creator
@@ -16,9 +16,9 @@ Gem::Specification.new do |s|
16
16
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
17
17
  s.require_paths = ['lib']
18
18
 
19
- s.post_install_message = File.read('UPGRADING') if File.exists?('UPGRADING')
19
+ s.post_install_message = File.read('UPGRADING') if File.exist?('UPGRADING')
20
20
 
21
- s.add_dependency 'mongoid', ['>= 6.0.0', '< 8.0']
21
+ s.add_dependency 'mongoid', ['>= 6.0.0', '< 9.0']
22
22
  s.add_runtime_dependency 'request_store'
23
23
 
24
24
  s.add_development_dependency 'rake'
@@ -130,6 +130,18 @@ describe Mongoid::Userstamp do
130
130
  end
131
131
  subject { Novel.new(name: 'Ethyl the Aardvark goes Quantity Surveying') }
132
132
 
133
+ context 'when created without user' do
134
+ before do
135
+ User.current = nil
136
+ subject.save!
137
+ end
138
+
139
+ it { expect(subject.c_by_id).to eq(nil) }
140
+ it { expect(subject.c_by).to eq(nil) }
141
+ it { expect(subject.u_by_id).to eq(nil) }
142
+ it { expect(subject.u_by).to eq(nil) }
143
+ end
144
+
133
145
  context 'when created by a user' do
134
146
  before do
135
147
  User.current = user_1
data/spec/mongoid.yml ADDED
@@ -0,0 +1,11 @@
1
+ test:
2
+ clients:
3
+ default:
4
+ database: mongoid_nested_set_test
5
+ hosts:
6
+ - localhost:27018
7
+ options:
8
+ user: 'admin'
9
+ password: 'rs123456'
10
+ auth_source: admin
11
+
data/spec/spec_helper.rb CHANGED
@@ -7,11 +7,7 @@ require 'active_support/all'
7
7
  require 'mongoid'
8
8
  require 'mongoid_userstamp'
9
9
 
10
- Mongoid.configure do |config|
11
- config.connect_to(
12
- 'mongoid_userstamp_test'
13
- )
14
- end
10
+ Mongoid.load!("#{File.dirname(__FILE__)}/mongoid.yml", :test)
15
11
 
16
12
  begin
17
13
  Object.send :remove_const, :Config
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glebtv_mongoid_userstamp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GlebTv
8
8
  - Thomas Boerger
9
9
  - Johnny Shields
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-05-21 00:00:00.000000000 Z
13
+ date: 2024-04-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mongoid
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 6.0.0
22
22
  - - "<"
23
23
  - !ruby/object:Gem::Version
24
- version: '8.0'
24
+ version: '9.0'
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
@@ -31,7 +31,7 @@ dependencies:
31
31
  version: 6.0.0
32
32
  - - "<"
33
33
  - !ruby/object:Gem::Version
34
- version: '8.0'
34
+ version: '9.0'
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: request_store
37
37
  requirement: !ruby/object:Gem::Requirement
@@ -96,6 +96,7 @@ files:
96
96
  - lib/mongoid/userstamp/version.rb
97
97
  - lib/mongoid_userstamp.rb
98
98
  - mongoid_mongoid_userstamp.gemspec
99
+ - spec/mongoid.yml
99
100
  - spec/mongoid/userstamp_spec.rb
100
101
  - spec/spec_helper.rb
101
102
  - spec/support/book.rb
@@ -104,7 +105,7 @@ homepage: https://github.com/glebtv/mongoid_userstamp
104
105
  licenses:
105
106
  - MIT
106
107
  metadata: {}
107
- post_install_message:
108
+ post_install_message:
108
109
  rdoc_options: []
109
110
  require_paths:
110
111
  - lib
@@ -119,11 +120,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
120
  - !ruby/object:Gem::Version
120
121
  version: '0'
121
122
  requirements: []
122
- rubygems_version: 3.0.3
123
- signing_key:
123
+ rubygems_version: 3.4.10
124
+ signing_key:
124
125
  specification_version: 4
125
126
  summary: Userstamp for Mongoid
126
127
  test_files:
128
+ - spec/mongoid.yml
127
129
  - spec/mongoid/userstamp_spec.rb
128
130
  - spec/spec_helper.rb
129
131
  - spec/support/book.rb