shiftable 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2aee0ddcd18b646324ef8ec890c7fc50aaf2af9c6b630c5267d3ec0143a7dedb
4
- data.tar.gz: c6bd0a6a3ddc61517dc9e162c4cf9e9861e23f832baaf8e013c3bbb12e97d868
3
+ metadata.gz: 79602092714ac55294711f0a60012290a85b20f46039eec63a2b698fcd433f0e
4
+ data.tar.gz: 61e2a2c47e9afe4c28b518d4ec6dc017e3a3441f2f7c513f17cc9630f04bb7cf
5
5
  SHA512:
6
- metadata.gz: 6e6b917230a28123480e5032766ee0e26dfc44c887f177d59b6f44fc9c1659eec0695a1513415f126a3de168b4315498eb7b26905e07350c16d72cec6e17234e
7
- data.tar.gz: 0f4765f281ec4cf5bd97e874fe6ee63dc171df5f178d028d99a1c89d886e00ea5906931e1f192467ddcd1206c2d473c8a6d738db0a0db3f8b9bd10454f171da1
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 07:00:27 UTC using RuboCop version 1.22.2.
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: 27
19
+ Max: 29
13
20
 
14
- # Offense count: 7
21
+ # Offense count: 13
15
22
  # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
16
23
  # IgnoredMethods: refine
17
24
  Metrics/BlockLength:
18
- Max: 58
25
+ Max: 87
19
26
 
20
- # Offense count: 1
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: 1
37
+ # Offense count: 2
31
38
  # Configuration parameters: IgnoredMethods.
32
39
  Metrics/PerceivedComplexity:
33
40
  Max: 11
34
41
 
35
- # Offense count: 2
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: 2
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]: https://github.com/pboling/shiftable/releases/tag/v0.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
@@ -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.call(shifting_rel: shifting_rel, shift_to: shift_to, shift_from: shift_from) if before_save
82
- shifting_rel.each do |shifting|
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shiftable
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shiftable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling