acts_as_removable 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +24 -0
- data/.travis.yml +12 -6
- data/Changelog.md +3 -0
- data/Gemfile +2 -0
- data/Rakefile +4 -2
- data/acts_as_removable.gemspec +11 -7
- data/gemfiles/{rails40 → rails51} +1 -1
- data/gemfiles/{rails41 → rails52} +1 -1
- data/gemfiles/{rails42 → rails60} +1 -1
- data/lib/acts_as_removable.rb +6 -6
- data/lib/acts_as_removable/version.rb +3 -1
- data/spec/acts_as_removable_spec.rb +5 -3
- data/spec/spec_helper.rb +2 -0
- metadata +49 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73a8321dc5f10d5b391838d8ef5e5ae42fd9234f79e11acd8897499baa529ff8
|
4
|
+
data.tar.gz: 35e65edd2a3231765e29002fe0685851b41ad5ef4917db4d85f4158f367085b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8385b5a3e3c992401e4690cd4c76520a1760d35a9c19543064cc4fa668b77164768df84a5cd2bb8e6966496b70f82a0e3779853443c4113abc6c4ba14ed46441
|
7
|
+
data.tar.gz: 7e403cfae73a20e6d76bcb255f9e0cbd1c0f73b8ca67ac5f3c23f686dd5c34c4501a20769e0dda38fd15a55acec4ad13bc4b8f6f83aad05dfe6437e4d84ee574
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
TargetRubyVersion: 2.4
|
6
|
+
|
7
|
+
Layout/AlignHash:
|
8
|
+
EnforcedHashRocketStyle: table
|
9
|
+
EnforcedColonStyle: table
|
10
|
+
|
11
|
+
Metrics/LineLength:
|
12
|
+
Max: 120
|
13
|
+
|
14
|
+
Metrics/AbcSize:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Metrics/MethodLength:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
Metrics/BlockLength:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
Style/Documentation:
|
24
|
+
Enabled: false
|
data/.travis.yml
CHANGED
@@ -3,16 +3,22 @@ sudo: false
|
|
3
3
|
language: ruby
|
4
4
|
|
5
5
|
rvm:
|
6
|
-
- 2.
|
7
|
-
- 2.
|
6
|
+
- 2.4.7
|
7
|
+
- 2.5.6
|
8
|
+
- 2.6.4
|
8
9
|
|
9
10
|
gemfile:
|
10
|
-
- gemfiles/rails40
|
11
|
-
- gemfiles/rails41
|
12
|
-
- gemfiles/rails42
|
13
11
|
- gemfiles/rails50
|
12
|
+
- gemfiles/rails51
|
13
|
+
- gemfiles/rails52
|
14
|
+
- gemfiles/rails60
|
15
|
+
|
16
|
+
matrix:
|
17
|
+
exclude:
|
18
|
+
- rvm: 2.4.7
|
19
|
+
gemfile: gemfiles/rails60
|
14
20
|
|
15
21
|
script: bundle exec rake spec
|
16
22
|
|
17
23
|
before_install:
|
18
|
-
- gem install bundler -v '~>
|
24
|
+
- gem install bundler -v '~> 2.0'
|
data/Changelog.md
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/acts_as_removable.gemspec
CHANGED
@@ -1,28 +1,32 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'English'
|
4
6
|
require 'acts_as_removable/version'
|
5
7
|
|
6
8
|
Gem::Specification.new do |spec|
|
7
9
|
spec.name = 'acts_as_removable'
|
8
10
|
spec.version = ActsAsRemovable::VERSION
|
9
11
|
spec.authors = ['Florian Schwab', 'Erik-B. Ernst']
|
10
|
-
spec.email = ['florian.schwab@sic
|
12
|
+
spec.email = ['florian.schwab@sic.software', 'erik.ernst@sic.software']
|
11
13
|
spec.description = 'Simplifies handling of pseudo removed records.'
|
12
14
|
spec.summary = 'Simplifies handling of pseudo removed records.'
|
13
15
|
spec.homepage = 'https://github.com/SICSoftwareGmbH/acts_as_removable'
|
14
16
|
spec.license = 'MIT'
|
15
17
|
|
16
|
-
spec.files = `git ls-files`.split(
|
18
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
17
19
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
20
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
21
|
spec.require_paths = ['lib']
|
20
22
|
|
21
|
-
spec.add_dependency 'activerecord', '>= 5.0', '
|
22
|
-
spec.add_dependency 'activesupport', '>= 5.0', '
|
23
|
+
spec.add_dependency 'activerecord', '>= 5.0', '< 6.1'
|
24
|
+
spec.add_dependency 'activesupport', '>= 5.0', '< 6.1'
|
23
25
|
|
24
|
-
spec.add_development_dependency 'bundler', '
|
26
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
25
27
|
spec.add_development_dependency 'rake'
|
26
28
|
spec.add_development_dependency 'rspec'
|
29
|
+
spec.add_development_dependency 'rubocop'
|
30
|
+
spec.add_development_dependency 'rubocop-performance'
|
27
31
|
spec.add_development_dependency 'sqlite3'
|
28
32
|
end
|
data/lib/acts_as_removable.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'active_support/concern'
|
2
4
|
require 'active_record'
|
3
|
-
require
|
5
|
+
require 'acts_as_removable/version'
|
4
6
|
|
5
7
|
module ActsAsRemovable
|
6
8
|
extend ActiveSupport::Concern
|
@@ -17,11 +19,11 @@ module ActsAsRemovable
|
|
17
19
|
def acts_as_removable(options = {})
|
18
20
|
_acts_as_removable_options.merge!(options)
|
19
21
|
|
20
|
-
scope :removed,
|
22
|
+
scope :removed, lambda {
|
21
23
|
where(all.table[_acts_as_removable_options[:column_name]].not_eq(nil).to_sql)
|
22
24
|
}
|
23
25
|
|
24
|
-
scope :actives,
|
26
|
+
scope :actives, lambda {
|
25
27
|
where(all.table[_acts_as_removable_options[:column_name]].eq(nil).to_sql)
|
26
28
|
}
|
27
29
|
|
@@ -76,9 +78,7 @@ module ActsAsRemovable
|
|
76
78
|
end
|
77
79
|
|
78
80
|
def _acts_as_removable_options
|
79
|
-
@_acts_as_removable_options ||= {
|
80
|
-
column_name: 'removed_at'
|
81
|
-
}
|
81
|
+
@_acts_as_removable_options ||= { column_name: 'removed_at' }
|
82
82
|
end
|
83
83
|
end
|
84
84
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe 'acts_as_removable' do
|
@@ -26,10 +28,10 @@ describe 'acts_as_removable' do
|
|
26
28
|
before do
|
27
29
|
# setup database
|
28
30
|
db_file = File.expand_path(File.join(File.dirname(__FILE__), '..', 'tmp', 'acts_as_removable.db'))
|
29
|
-
Dir
|
31
|
+
Dir.mkdir(File.dirname(db_file)) unless File.exist?(File.dirname(db_file))
|
30
32
|
ActiveRecord::Base.establish_connection(
|
31
|
-
:
|
32
|
-
:
|
33
|
+
adapter: 'sqlite3',
|
34
|
+
database: "#{File.expand_path(File.join(File.dirname(__FILE__), '..'))}/tmp/acts_as_removable.db"
|
33
35
|
)
|
34
36
|
ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS 'my_models'")
|
35
37
|
ActiveRecord::Base.connection.create_table(:my_models) do |t|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_removable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Schwab
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-11-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -18,9 +18,9 @@ dependencies:
|
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '5.0'
|
21
|
-
- - "
|
21
|
+
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '6.
|
23
|
+
version: '6.1'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -28,9 +28,9 @@ dependencies:
|
|
28
28
|
- - ">="
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: '5.0'
|
31
|
-
- - "
|
31
|
+
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '6.
|
33
|
+
version: '6.1'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: activesupport
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,9 +38,9 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5.0'
|
41
|
-
- - "
|
41
|
+
- - "<"
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '6.
|
43
|
+
version: '6.1'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
46
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -48,23 +48,23 @@ dependencies:
|
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: '5.0'
|
51
|
-
- - "
|
51
|
+
- - "<"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '6.
|
53
|
+
version: '6.1'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: bundler
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - "
|
58
|
+
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '2.0'
|
61
61
|
type: :development
|
62
62
|
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "
|
65
|
+
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
67
|
+
version: '2.0'
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
69
|
name: rake
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,6 +93,34 @@ dependencies:
|
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '0'
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: rubocop
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: rubocop-performance
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
type: :development
|
118
|
+
prerelease: false
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
96
124
|
- !ruby/object:Gem::Dependency
|
97
125
|
name: sqlite3
|
98
126
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,12 +137,14 @@ dependencies:
|
|
109
137
|
version: '0'
|
110
138
|
description: Simplifies handling of pseudo removed records.
|
111
139
|
email:
|
112
|
-
- florian.schwab@sic
|
140
|
+
- florian.schwab@sic.software
|
141
|
+
- erik.ernst@sic.software
|
113
142
|
executables: []
|
114
143
|
extensions: []
|
115
144
|
extra_rdoc_files: []
|
116
145
|
files:
|
117
146
|
- ".gitignore"
|
147
|
+
- ".rubocop.yml"
|
118
148
|
- ".travis.yml"
|
119
149
|
- Changelog.md
|
120
150
|
- Gemfile
|
@@ -122,10 +152,10 @@ files:
|
|
122
152
|
- README.md
|
123
153
|
- Rakefile
|
124
154
|
- acts_as_removable.gemspec
|
125
|
-
- gemfiles/rails40
|
126
|
-
- gemfiles/rails41
|
127
|
-
- gemfiles/rails42
|
128
155
|
- gemfiles/rails50
|
156
|
+
- gemfiles/rails51
|
157
|
+
- gemfiles/rails52
|
158
|
+
- gemfiles/rails60
|
129
159
|
- lib/acts_as_removable.rb
|
130
160
|
- lib/acts_as_removable/version.rb
|
131
161
|
- spec/acts_as_removable_spec.rb
|
@@ -149,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
179
|
- !ruby/object:Gem::Version
|
150
180
|
version: '0'
|
151
181
|
requirements: []
|
152
|
-
rubygems_version: 3.0.
|
182
|
+
rubygems_version: 3.0.6
|
153
183
|
signing_key:
|
154
184
|
specification_version: 4
|
155
185
|
summary: Simplifies handling of pseudo removed records.
|