shiftable 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +29 -8
- data/CHANGELOG.md +14 -2
- data/lib/shiftable/collection.rb +2 -4
- data/lib/shiftable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79602092714ac55294711f0a60012290a85b20f46039eec63a2b698fcd433f0e
|
4
|
+
data.tar.gz: 61e2a2c47e9afe4c28b518d4ec6dc017e3a3441f2f7c513f17cc9630f04bb7cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d14b60642c03f4576cfae6030efffbe8de8dc9b1ea0b9d7db9ccb7ceea88f2de2582510918998e2e82ef146ca6adaf94d4f2eb9c10522363d8f705bcc24c6747
|
7
|
+
data.tar.gz: 6d4793fc03014121e8c4ab2eaf369bbdadb892c94b52c897b25b05c1c2903c82310c6256fc5ba57c47df688f15147294b7a3236994f477196bd747570165c87a
|
data/.rubocop_todo.yml
CHANGED
@@ -1,23 +1,30 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2021-10-23
|
3
|
+
# on 2021-10-23 10:42:13 UTC using RuboCop version 1.22.2.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
9
|
# Offense count: 1
|
10
|
+
# Cop supports --auto-correct.
|
11
|
+
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
|
12
|
+
Lint/UnusedMethodArgument:
|
13
|
+
Exclude:
|
14
|
+
- 'lib/shiftable/collection.rb'
|
15
|
+
|
16
|
+
# Offense count: 2
|
10
17
|
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
11
18
|
Metrics/AbcSize:
|
12
|
-
Max:
|
19
|
+
Max: 29
|
13
20
|
|
14
|
-
# Offense count:
|
21
|
+
# Offense count: 13
|
15
22
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
16
23
|
# IgnoredMethods: refine
|
17
24
|
Metrics/BlockLength:
|
18
|
-
Max:
|
25
|
+
Max: 87
|
19
26
|
|
20
|
-
# Offense count:
|
27
|
+
# Offense count: 2
|
21
28
|
# Configuration parameters: IgnoredMethods.
|
22
29
|
Metrics/CyclomaticComplexity:
|
23
30
|
Max: 11
|
@@ -27,18 +34,32 @@ Metrics/CyclomaticComplexity:
|
|
27
34
|
Metrics/MethodLength:
|
28
35
|
Max: 25
|
29
36
|
|
30
|
-
# Offense count:
|
37
|
+
# Offense count: 2
|
31
38
|
# Configuration parameters: IgnoredMethods.
|
32
39
|
Metrics/PerceivedComplexity:
|
33
40
|
Max: 11
|
34
41
|
|
35
|
-
# Offense count:
|
42
|
+
# Offense count: 1
|
43
|
+
Style/CombinableLoops:
|
44
|
+
Exclude:
|
45
|
+
- 'spec/shiftable/collection_spec.rb'
|
46
|
+
|
47
|
+
# Offense count: 4
|
36
48
|
# Cop supports --auto-correct.
|
37
49
|
Style/EvalWithLocation:
|
38
50
|
Exclude:
|
51
|
+
- 'spec/shiftable/collection_spec.rb'
|
39
52
|
- 'spec/shiftable/single_spec.rb'
|
40
53
|
|
41
|
-
# Offense count:
|
54
|
+
# Offense count: 1
|
55
|
+
# Cop supports --auto-correct.
|
56
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
|
57
|
+
# AllowedMethods: present?, blank?, presence, try, try!
|
58
|
+
Style/SafeNavigation:
|
59
|
+
Exclude:
|
60
|
+
- 'lib/shiftable/collection.rb'
|
61
|
+
|
62
|
+
# Offense count: 7
|
42
63
|
# Cop supports --auto-correct.
|
43
64
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
44
65
|
# URISchemes: http, https
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,18 @@
|
|
5
5
|
### Added
|
6
6
|
|
7
7
|
- Initial release
|
8
|
-
- feat: supports shifting of records associated as has_one / belongs_to
|
8
|
+
- feat: supports shifting of records associated as has_one / belongs_to and has_many / belongs_to, including with STI.
|
9
|
+
- 100% test coverage
|
9
10
|
|
10
|
-
[0.1.0]
|
11
|
+
## [0.1.0] - 2021-10-23
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
|
15
|
+
- Github Actions build
|
16
|
+
|
17
|
+
### Updated
|
18
|
+
|
19
|
+
- Linting
|
20
|
+
|
21
|
+
[0.1.0]: https://github.com/pboling/shiftable/releases/tag/v0.1.0
|
22
|
+
[0.1.1]: https://github.com/pboling/shiftable/releases/tag/v0.1.1
|
data/lib/shiftable/collection.rb
CHANGED
@@ -78,10 +78,8 @@ module Shiftable
|
|
78
78
|
shifting_rel.each do |shifting|
|
79
79
|
shifting.send("#{send("#{mepr}shift_cx_column")}=", shift_to.id)
|
80
80
|
end
|
81
|
-
before_save
|
82
|
-
shifting_rel.each
|
83
|
-
shifting.save
|
84
|
-
end
|
81
|
+
before_save&.call(shifting_rel: shifting_rel, shift_to: shift_to, shift_from: shift_from)
|
82
|
+
shifting_rel.each(&:save)
|
85
83
|
shifting_rel
|
86
84
|
end
|
87
85
|
end
|
data/lib/shiftable/version.rb
CHANGED