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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d89864582bca4bb737733162307fc2e264e359abd9eea47dc117a52fd6b052ab
4
- data.tar.gz: ff4c33501e5b97a57fb575e438f9d9513247883a548bd24a993d5e12f70368e4
3
+ metadata.gz: b9e8c38698965332861203644597ab14434bce9c22f9b661fcc86d8a799e0157
4
+ data.tar.gz: 52ab46bdb38970d3e6143d1d93e963b333760426a5e656f0aacc6e68fc5fdb8b
5
5
  SHA512:
6
- metadata.gz: 14edc5f3d86dd3e76752013f175131d2c4f0d03eef67b72c69376df66fde4a76fbbf6ab0accfa84dad3e7a5a1afa241aa645a770fef0d13c140b5cf4467a98c7
7
- data.tar.gz: c1834818a1059859a027e76470aa596f7028bac2bf537678e888f0721bada71f6119e2293f1b63e12dc0cccd01a515cbc82731d79900f3bf97c6b94605dd0e24
6
+ metadata.gz: 41b91ff8181515293624fb6b50dd3585d8ddc443354447a81f71fc3e55606f1d81d46120b4abcdc5c26bc74fff821285bbfd90af3747627eafb75fc82069849e
7
+ data.tar.gz: 2ba5f604bcc2ee1e8b257adb7bb11434ce79da2f3162f85731ac0b2ee7ef50acb2348cf534b406671faea7143395a183cde7b0c89a596e58ecde13c7b75599cd
data/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  /Gemfile.lock
5
5
  /coverage/
6
6
  /doc/
7
+ /gemfiles/*.gemfile.lock
7
8
  /pkg/
8
9
  /spec/reports/
9
10
  /tmp/
data/.rspec CHANGED
File without changes
@@ -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
@@ -3,10 +3,24 @@ sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.4.4
7
- - 2.5.1
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
- before_install: gem install bundler -v 1.16.4
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
@@ -1,6 +1,17 @@
1
1
  ## Unreleased
2
2
 
3
3
 
4
+ ## 0.4.0 (2019-08-22)
5
+
6
+ ### Cbanges
7
+
8
+ * Support ActiveRecord 6.0.0
9
+
10
+ ### Misc
11
+
12
+ * Improve rspec and CI
13
+
14
+
4
15
  ## 0.3.0 (2018-10-05)
5
16
 
6
17
  ### Breaking changes
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")
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 `current_attributes_store` | `:thread_store` |
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 ActivgeSupport 5.2 or later.
123
+ So, this requires ActiveSupport 5.2 or later.
124
124
 
125
125
 
126
126
  ## Development
data/Rakefile CHANGED
File without changes
@@ -3,5 +3,6 @@
3
3
  source "https://rubygems.org/"
4
4
 
5
5
  gem "activerecord", "~> 5.0.0"
6
+ gem "sqlite3", "~> 1.3.13"
6
7
 
7
8
  gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org/"
4
+
5
+ gem "activerecord", "~> 5.0.0"
6
+ gem "request_store"
7
+ gem "sqlite3", "~> 1.3.13"
8
+
9
+ gemspec path: "../"
File without changes
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org/"
4
+
5
+ gem "activerecord", "~> 5.1.0"
6
+ gem "request_store"
7
+
8
+ gemspec path: "../"
File without changes
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org/"
4
+
5
+ gem "activerecord", "~> 5.2.0"
6
+ gem "request_store"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org/"
4
+
5
+ gem "activerecord", "~> 6.0.0"
6
+ gem "sqlite3", "~> 1.4"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org/"
4
+
5
+ gem "activerecord", "~> 6.0.0"
6
+ gem "request_store"
7
+ gem "sqlite3", "~> 1.4"
8
+
9
+ gemspec path: "../"
File without changes
@@ -31,7 +31,7 @@ module OperatorRecordable
31
31
 
32
32
  attr_reader :config
33
33
 
34
- def initialize_config(config)
34
+ def initialize_config(config) # rubocop:disable Metrics/MethodLength
35
35
  {
36
36
  operator_class_name: "Operator",
37
37
  creator_column_name: "created_by",
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OperatorRecordable
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
@@ -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 = "OperatorRecordable is a Rails plugin to set created_by, updated_by, and deleted_by to ActiveRecord objects."
14
- spec.description = "OperatorRecordable is a Rails plugin that makes your ActiveRecord models to be saved or logically deleted with automatically set created_by, updated_by, and deleted_by. Also it makes creator, updater, deleter belongs_to association if a class has created_by, updated_by, or deleted_by."
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", "~> 5.0"
28
- spec.add_development_dependency "bundler", "~> 1.16"
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 "sqlite3", "~> 1.0"
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.3.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: 2018-10-05 00:00:00.000000000 Z
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: request_store
70
+ name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
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: '0'
82
+ version: '3.7'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rspec
84
+ name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '3.7'
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: '3.7'
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: '1.0'
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: '1.0'
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