operator_recordable 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rspec +0 -0
- data/.rubocop.yml +30 -0
- data/.travis.yml +17 -3
- data/CHANGELOG.md +11 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +0 -0
- data/README.md +2 -2
- data/Rakefile +0 -0
- data/gemfiles/activerecord_5.0.gemfile +1 -0
- data/gemfiles/activerecord_5.0_with_request_store.gemfile +9 -0
- data/gemfiles/activerecord_5.1.gemfile +0 -0
- data/gemfiles/activerecord_5.1_with_request_store.gemfile +8 -0
- data/gemfiles/activerecord_5.2.gemfile +0 -0
- data/gemfiles/activerecord_5.2_with_request_store.gemfile +8 -0
- data/gemfiles/activerecord_6.0.gemfile +8 -0
- data/gemfiles/activerecord_6.0_with_request_store.gemfile +9 -0
- data/lib/operator_recordable.rb +0 -0
- data/lib/operator_recordable/configuration.rb +1 -1
- data/lib/operator_recordable/extension.rb +0 -0
- data/lib/operator_recordable/recorder.rb +2 -2
- data/lib/operator_recordable/store.rb +0 -0
- data/lib/operator_recordable/store/current_attributes_store.rb +0 -0
- data/lib/operator_recordable/store/request_store.rb +0 -0
- data/lib/operator_recordable/store/thread_store.rb +0 -0
- data/lib/operator_recordable/version.rb +1 -1
- data/operator_recordable.gemspec +16 -7
- metadata +28 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9e8c38698965332861203644597ab14434bce9c22f9b661fcc86d8a799e0157
|
4
|
+
data.tar.gz: 52ab46bdb38970d3e6143d1d93e963b333760426a5e656f0aacc6e68fc5fdb8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41b91ff8181515293624fb6b50dd3585d8ddc443354447a81f71fc3e55606f1d81d46120b4abcdc5c26bc74fff821285bbfd90af3747627eafb75fc82069849e
|
7
|
+
data.tar.gz: 2ba5f604bcc2ee1e8b257adb7bb11434ce79da2f3162f85731ac0b2ee7ef50acb2348cf534b406671faea7143395a183cde7b0c89a596e58ecde13c7b75599cd
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
File without changes
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.4
|
3
|
+
|
4
|
+
Style/AsciiComments:
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
Style/Documentation:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Style/RedundantSelf:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Style/StringLiterals:
|
14
|
+
Enabled: true
|
15
|
+
EnforcedStyle: double_quotes
|
16
|
+
|
17
|
+
Layout/EndOfLine:
|
18
|
+
Enabled: true
|
19
|
+
EnforcedStyle: lf
|
20
|
+
|
21
|
+
Metrics/BlockLength:
|
22
|
+
Exclude:
|
23
|
+
- spec/**/*
|
24
|
+
|
25
|
+
Metrics/MethodLength:
|
26
|
+
Exclude:
|
27
|
+
- spec/**/*
|
28
|
+
|
29
|
+
Metrics/LineLength:
|
30
|
+
Max: 128
|
data/.travis.yml
CHANGED
@@ -3,10 +3,24 @@ sudo: false
|
|
3
3
|
language: ruby
|
4
4
|
cache: bundler
|
5
5
|
rvm:
|
6
|
-
- 2.4.
|
7
|
-
- 2.5.
|
6
|
+
- 2.4.6
|
7
|
+
- 2.5.5
|
8
|
+
- 2.6.3
|
9
|
+
- 2.7.0-preview1
|
8
10
|
gemfile:
|
9
11
|
- gemfiles/activerecord_5.0.gemfile
|
12
|
+
- gemfiles/activerecord_5.0_with_request_store.gemfile
|
10
13
|
- gemfiles/activerecord_5.1.gemfile
|
14
|
+
- gemfiles/activerecord_5.1_with_request_store.gemfile
|
11
15
|
- gemfiles/activerecord_5.2.gemfile
|
12
|
-
|
16
|
+
- gemfiles/activerecord_5.2_with_request_store.gemfile
|
17
|
+
- gemfiles/activerecord_6.0.gemfile
|
18
|
+
- gemfiles/activerecord_6.0_with_request_store.gemfile
|
19
|
+
matrix:
|
20
|
+
exclude:
|
21
|
+
- rvm: 2.4.6
|
22
|
+
gemfile: gemfiles/activerecord_6.0.gemfile
|
23
|
+
- rvm: 2.4.6
|
24
|
+
gemfile: gemfiles/activerecord_6.0_with_request_store.gemfile
|
25
|
+
allow_failures:
|
26
|
+
rvm: 2.7.0-preview1
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -6,3 +6,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
6
6
|
|
7
7
|
# Specify your gem's dependencies in operator_recordable.gemspec
|
8
8
|
gemspec
|
9
|
+
|
10
|
+
gem "activerecord", ENV.fetch("AR_VERSION", "~> 6.0.0")
|
11
|
+
gem "request_store" unless ENV["WITHOUT_REQUEST_STORE"]
|
12
|
+
gem "sqlite3", ENV.fetch("SQLITE3_VERSION", ">= 1.4.0")
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
@@ -60,7 +60,7 @@ OperatorRecordable.config = {
|
|
60
60
|
| `deleter_association_name` | String | association name of deleter. | `"deleter"` |
|
61
61
|
| `operator_association_options` | Hash | options of operator associations. e.g. `{ optional: true }` | `{}` |
|
62
62
|
| `operator_association_scope` | Proc | The scope of operator associations. e.g. `-> { with_deleted }` | `nil` |
|
63
|
-
| `store` | Enum | operator store. any value of `:thread_store`, `:request_store` or
|
63
|
+
| `store` | Enum | operator store. any value of `:thread_store`, `:request_store` or `:current_attributes_store` | `:thread_store` |
|
64
64
|
|
65
65
|
#### Include `OperatorRecordable` in your model
|
66
66
|
|
@@ -120,7 +120,7 @@ require "operator_recordable/store/request_store"
|
|
120
120
|
#### `:current_attributes_store`
|
121
121
|
|
122
122
|
This store is implemented by using [`ActiveSupport::CurrentAttributes`](https://api.rubyonrails.org/v5.2.0/classes/ActiveSupport/CurrentAttributes.html).
|
123
|
-
So, this requires
|
123
|
+
So, this requires ActiveSupport 5.2 or later.
|
124
124
|
|
125
125
|
|
126
126
|
## Development
|
data/Rakefile
CHANGED
File without changes
|
File without changes
|
File without changes
|
data/lib/operator_recordable.rb
CHANGED
File without changes
|
File without changes
|
@@ -10,10 +10,10 @@ module OperatorRecordable
|
|
10
10
|
|
11
11
|
private
|
12
12
|
|
13
|
-
def define_activate_method(config)
|
13
|
+
def define_activate_method(config) # rubocop:disable Metrics/MethodLength
|
14
14
|
m = self
|
15
15
|
|
16
|
-
define_method :record_operator_on do |*actions|
|
16
|
+
define_method :record_operator_on do |*actions| # rubocop:disable Metrics/MethodLength
|
17
17
|
c = Configuration::Model.new(actions)
|
18
18
|
|
19
19
|
if c.record_creator?
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/operator_recordable.gemspec
CHANGED
@@ -4,14 +4,23 @@ lib = File.expand_path("lib", __dir__)
|
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
require "operator_recordable/version"
|
6
6
|
|
7
|
-
Gem::Specification.new do |spec|
|
7
|
+
Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
8
8
|
spec.name = "operator_recordable"
|
9
9
|
spec.version = OperatorRecordable::VERSION
|
10
10
|
spec.authors = ["Yuji Hanamura"]
|
11
11
|
spec.email = ["yuji.developer@gmail.com"]
|
12
12
|
|
13
|
-
spec.summary = "
|
14
|
-
|
13
|
+
spec.summary = <<~SUMMARY.tr("\n", " ")
|
14
|
+
OperatorRecordable is a Rails plugin to set created_by, updated_by, and
|
15
|
+
deleted_by to ActiveRecord objects.
|
16
|
+
SUMMARY
|
17
|
+
spec.description = <<~DESC.tr("\n", " ") # rubocop:disable Layout/ExtraSpacing, Layout/SpaceAroundOperators
|
18
|
+
OperatorRecordable is a Rails plugin that makes your ActiveRecord models
|
19
|
+
to be saved or logically deleted with automatically set created_by,
|
20
|
+
updated_by, and deleted_by. Also it makes creator, updater, deleter
|
21
|
+
belongs_to association if a class has created_by, updated_by, or
|
22
|
+
deleted_by.
|
23
|
+
DESC
|
15
24
|
spec.homepage = "https://github.com/yujideveloper/operator_recordable"
|
16
25
|
spec.license = "MIT"
|
17
26
|
|
@@ -24,11 +33,11 @@ Gem::Specification.new do |spec|
|
|
24
33
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
34
|
spec.require_paths = ["lib"]
|
26
35
|
|
27
|
-
spec.add_dependency "activerecord", "
|
28
|
-
spec.add_development_dependency "bundler", "
|
36
|
+
spec.add_dependency "activerecord", ">= 5.0"
|
37
|
+
spec.add_development_dependency "bundler", ">= 1.16"
|
29
38
|
spec.add_development_dependency "pry", ">= 0.10.0"
|
30
39
|
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
-
spec.add_development_dependency "request_store"
|
32
40
|
spec.add_development_dependency "rspec", "~> 3.7"
|
33
|
-
spec.add_development_dependency "
|
41
|
+
spec.add_development_dependency "rubocop", ">= 0.61.1"
|
42
|
+
spec.add_development_dependency "sqlite3", ">= 1.3.13"
|
34
43
|
end
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: operator_recordable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Hanamura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '5.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.16'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.16'
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -67,51 +67,51 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '10.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '3.7'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '3.7'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rubocop
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.61.1
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.61.1
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: sqlite3
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 1.3.13
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
111
|
-
description: OperatorRecordable is a Rails plugin that makes your ActiveRecord models
|
110
|
+
version: 1.3.13
|
111
|
+
description: 'OperatorRecordable is a Rails plugin that makes your ActiveRecord models
|
112
112
|
to be saved or logically deleted with automatically set created_by, updated_by,
|
113
113
|
and deleted_by. Also it makes creator, updater, deleter belongs_to association if
|
114
|
-
a class has created_by, updated_by, or deleted_by.
|
114
|
+
a class has created_by, updated_by, or deleted_by. '
|
115
115
|
email:
|
116
116
|
- yuji.developer@gmail.com
|
117
117
|
executables: []
|
@@ -120,6 +120,7 @@ extra_rdoc_files: []
|
|
120
120
|
files:
|
121
121
|
- ".gitignore"
|
122
122
|
- ".rspec"
|
123
|
+
- ".rubocop.yml"
|
123
124
|
- ".travis.yml"
|
124
125
|
- CHANGELOG.md
|
125
126
|
- Gemfile
|
@@ -129,8 +130,13 @@ files:
|
|
129
130
|
- bin/console
|
130
131
|
- bin/setup
|
131
132
|
- gemfiles/activerecord_5.0.gemfile
|
133
|
+
- gemfiles/activerecord_5.0_with_request_store.gemfile
|
132
134
|
- gemfiles/activerecord_5.1.gemfile
|
135
|
+
- gemfiles/activerecord_5.1_with_request_store.gemfile
|
133
136
|
- gemfiles/activerecord_5.2.gemfile
|
137
|
+
- gemfiles/activerecord_5.2_with_request_store.gemfile
|
138
|
+
- gemfiles/activerecord_6.0.gemfile
|
139
|
+
- gemfiles/activerecord_6.0_with_request_store.gemfile
|
134
140
|
- lib/operator_recordable.rb
|
135
141
|
- lib/operator_recordable/configuration.rb
|
136
142
|
- lib/operator_recordable/extension.rb
|