fixably 0.2.0 → 0.6.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: 5f29bd52c1bffd5295a5166642706b8520ec60f030a224b91a289e65a6f57c2f
4
- data.tar.gz: b0cff7c565e74ef04ed8d827e9e78c2bed1bb559e79a8b530584220bb8ac96d2
3
+ metadata.gz: aa642fce50530577696a77601009ab1f648ebfc88b8e16eabd60508e0f8d92b1
4
+ data.tar.gz: f976b04bc5520f56c4992ca212d6d80766a293f1f760e732b9ba8b4bddc9d109
5
5
  SHA512:
6
- metadata.gz: 2fa6840875acab195e03712b89353a989440a1b8e9cd6ff5063090da999f1028533f7601a12a30cccfde07f6f853e3abc6daf9d78084bab6dba6fa1cbf7ea8d2
7
- data.tar.gz: 66adc06a408eff0fed3e8ed18f27855ddadd4cbaa84fb933469d7fee36ccbbb0d2124852506e67b3ddc27d5a391b0ec8e97834e7f60a6ee7cc97fe000815ad76
6
+ metadata.gz: 417371bd0fa8b480e46fcf284f16c3f7a5618717d42d10baec9396b0f47844aa0a5dc79c8b9c2de742042a6b683ed29f14ac9b8baccf4fb3d61244b403a2efdb
7
+ data.tar.gz: 684a62a5e666ba1f00eb92eafd6ca231bb24f917824cbf3e32248b8a7efaab0d458e511e7cd8b41afcb30b20e730d39b5622f878d0f40081fabecb517966403d
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fixably (0.2.0)
5
- activeresource (~> 5)
4
+ fixably (0.5.0)
5
+ activeresource (>= 5, < 7)
6
6
 
7
7
  GEM
8
8
  remote: https://com:jE6Df8B6dPoghEjlbPTiQzMi34dvbO12@gem.mutant.dev/
@@ -12,42 +12,42 @@ GEM
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activemodel (6.1.4.1)
16
- activesupport (= 6.1.4.1)
15
+ activemodel (7.0.1)
16
+ activesupport (= 7.0.1)
17
17
  activemodel-serializers-xml (1.0.2)
18
18
  activemodel (> 5.x)
19
19
  activesupport (> 5.x)
20
20
  builder (~> 3.1)
21
- activeresource (5.1.1)
22
- activemodel (>= 5.0, < 7)
21
+ activeresource (6.0.0)
22
+ activemodel (>= 6.0)
23
23
  activemodel-serializers-xml (~> 1.0)
24
- activesupport (>= 5.0, < 7)
25
- activesupport (6.1.4.1)
24
+ activesupport (>= 6.0)
25
+ activesupport (7.0.1)
26
26
  concurrent-ruby (~> 1.0, >= 1.0.2)
27
27
  i18n (>= 1.6, < 2)
28
28
  minitest (>= 5.1)
29
29
  tzinfo (~> 2.0)
30
- zeitwerk (~> 2.3)
31
30
  ast (2.4.2)
32
31
  builder (3.2.4)
33
32
  byebug (11.1.3)
34
33
  coderay (1.1.3)
35
34
  concurrent-ruby (1.1.9)
36
- diff-lcs (1.4.4)
37
- i18n (1.8.10)
35
+ diff-lcs (1.5.0)
36
+ i18n (1.8.11)
38
37
  concurrent-ruby (~> 1.0)
39
38
  method_source (1.0.0)
40
- minitest (5.14.4)
41
- mutant (0.10.34)
39
+ minitest (5.15.0)
40
+ mutant (0.11.2)
42
41
  diff-lcs (~> 1.3)
43
42
  parser (~> 3.0.0)
44
43
  regexp_parser (~> 2.0, >= 2.0.3)
45
- unparser (~> 0.6.0)
46
- mutant-rspec (0.10.34)
47
- mutant (= 0.10.34)
44
+ sorbet-runtime (~> 0.5.0)
45
+ unparser (~> 0.6.2)
46
+ mutant-rspec (0.11.2)
47
+ mutant (= 0.11.2)
48
48
  rspec-core (>= 3.8.0, < 4.0.0)
49
- parallel (1.20.1)
50
- parser (3.0.2.0)
49
+ parallel (1.21.0)
50
+ parser (3.0.3.2)
51
51
  ast (~> 2.4.1)
52
52
  pry (0.13.1)
53
53
  coderay (~> 1.1)
@@ -55,9 +55,9 @@ GEM
55
55
  pry-byebug (3.9.0)
56
56
  byebug (~> 11.0)
57
57
  pry (~> 0.13.0)
58
- rainbow (3.0.0)
58
+ rainbow (3.1.1)
59
59
  rake (13.0.6)
60
- regexp_parser (2.1.1)
60
+ regexp_parser (2.2.0)
61
61
  rexml (3.2.5)
62
62
  rspec (3.10.0)
63
63
  rspec-core (~> 3.10.0)
@@ -65,42 +65,42 @@ GEM
65
65
  rspec-mocks (~> 3.10.0)
66
66
  rspec-core (3.10.1)
67
67
  rspec-support (~> 3.10.0)
68
- rspec-expectations (3.10.1)
68
+ rspec-expectations (3.10.2)
69
69
  diff-lcs (>= 1.2.0, < 2.0)
70
70
  rspec-support (~> 3.10.0)
71
71
  rspec-mocks (3.10.2)
72
72
  diff-lcs (>= 1.2.0, < 2.0)
73
73
  rspec-support (~> 3.10.0)
74
- rspec-support (3.10.2)
75
- rubocop (1.20.0)
74
+ rspec-support (3.10.3)
75
+ rubocop (1.24.1)
76
76
  parallel (~> 1.10)
77
77
  parser (>= 3.0.0.0)
78
78
  rainbow (>= 2.2.2, < 4.0)
79
79
  regexp_parser (>= 1.8, < 3.0)
80
80
  rexml
81
- rubocop-ast (>= 1.9.1, < 2.0)
81
+ rubocop-ast (>= 1.15.1, < 2.0)
82
82
  ruby-progressbar (~> 1.7)
83
83
  unicode-display_width (>= 1.4.0, < 3.0)
84
- rubocop-ast (1.11.0)
84
+ rubocop-ast (1.15.1)
85
85
  parser (>= 3.0.1.1)
86
- rubocop-performance (1.11.5)
86
+ rubocop-performance (1.13.2)
87
87
  rubocop (>= 1.7.0, < 2.0)
88
88
  rubocop-ast (>= 0.4.0)
89
89
  rubocop-rake (0.6.0)
90
90
  rubocop (~> 1.0)
91
- rubocop-rspec (2.4.0)
92
- rubocop (~> 1.0)
93
- rubocop-ast (>= 1.1.0)
91
+ rubocop-rspec (2.7.0)
92
+ rubocop (~> 1.19)
94
93
  ruby-progressbar (1.11.0)
94
+ sorbet-runtime (0.5.9531)
95
95
  tzinfo (2.0.4)
96
96
  concurrent-ruby (~> 1.0)
97
- unicode-display_width (2.0.0)
98
- unparser (0.6.0)
97
+ unicode-display_width (2.1.0)
98
+ unparser (0.6.2)
99
99
  diff-lcs (~> 1.3)
100
100
  parser (>= 3.0.0)
101
- zeitwerk (2.4.2)
102
101
 
103
102
  PLATFORMS
103
+ arm64-darwin-21
104
104
  x86_64-darwin-20
105
105
 
106
106
  DEPENDENCIES
@@ -7,7 +7,7 @@ The Fixably API does not allow children to be searched
7
7
  ## Get a child
8
8
 
9
9
  ```ruby
10
- Fixably::Customer::Child.find(1000, customer_id: 1000)
10
+ Fixably::Customer::Child.find(1_000, customer_id: 1_000)
11
11
  ```
12
12
 
13
13
  ## Create a child
data/docs/order/line.md CHANGED
@@ -3,15 +3,15 @@
3
3
  ## List order lines
4
4
 
5
5
  ```ruby
6
- Fixably::Order::Line.all(order_id: 1000)
6
+ Fixably::Order::Line.all(order_id: 1_000)
7
7
  ```
8
8
 
9
9
  ## Get an order line
10
10
 
11
11
  ```ruby
12
- Fixably::Order::Line.find(1000, order_id: 1000)
13
- Fixably::Order::Line.first(order_id: 1000)
14
- Fixably::Order::Line.last(order_id: 1000)
12
+ Fixably::Order::Line.find(1_000, order_id: 1_000)
13
+ Fixably::Order::Line.first(order_id: 1_000)
14
+ Fixably::Order::Line.last(order_id: 1_000)
15
15
  ```
16
16
 
17
17
  ## Create an order line
data/docs/order/note.md CHANGED
@@ -3,15 +3,22 @@
3
3
  ## List order notes
4
4
 
5
5
  ```ruby
6
- Fixably::Order::Note.all(order_id: 1000)
6
+ Fixably::Order::Note.all(order_id: 1_000)
7
+ ```
8
+
9
+ ### Include associations in a list
10
+
11
+ **Created by**
12
+ ```ruby
13
+ Fixably::Order.includes(:created_by).all(order_id: 1_000)
7
14
  ```
8
15
 
9
16
  ## Get an order note
10
17
 
11
18
  ```ruby
12
- Fixably::Order::Note.find(1000, order_id: 1000)
13
- Fixably::Order::Note.first(order_id: 1000)
14
- Fixably::Order::Note.last(order_id: 1000)
19
+ Fixably::Order::Note.find(1_000, order_id: 1_000)
20
+ Fixably::Order::Note.first(order_id: 1_000)
21
+ Fixably::Order::Note.last(order_id: 1_000)
15
22
  ```
16
23
 
17
24
  ## Create an order note
data/docs/order/task.md CHANGED
@@ -3,15 +3,15 @@
3
3
  ## List order tasks
4
4
 
5
5
  ```ruby
6
- Fixably::Order::Task.all(order_id: 1000)
6
+ Fixably::Order::Task.all(order_id: 1_000)
7
7
  ```
8
8
 
9
9
  ## Get an order task
10
10
 
11
11
  ```ruby
12
- Fixably::Order::Task.find(1000, order_id: 1000)
13
- Fixably::Order::Task.first(order_id: 1000)
14
- Fixably::Order::Task.last(order_id: 1000)
12
+ Fixably::Order::Task.find(1_000, order_id: 1_000)
13
+ Fixably::Order::Task.first(order_id: 1_000)
14
+ Fixably::Order::Task.last(order_id: 1_000)
15
15
  ```
16
16
 
17
17
  ## Create an order task
data/docs/order.md CHANGED
@@ -79,7 +79,7 @@ Fixably::Order.includes(:tasks).all
79
79
  Fixably::Order.includes(:tasks).where(internal_location: "SERVICE")
80
80
  ```
81
81
 
82
- ## Get a customer
82
+ ## Get an order
83
83
 
84
84
  ```ruby
85
85
  Fixably::Order.find(1_000)
data/fixably.gemspec CHANGED
@@ -13,6 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.license = "MIT"
14
14
  spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
15
15
 
16
+ spec.metadata["rubygems_mfa_required"] = "true"
16
17
  spec.metadata["homepage_uri"] = spec.homepage
17
18
  spec.metadata["source_code_uri"] = spec.homepage
18
19
 
@@ -25,7 +26,7 @@ Gem::Specification.new do |spec|
25
26
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
26
27
  spec.require_paths = ["lib"]
27
28
 
28
- spec.add_dependency "activeresource", "~> 5"
29
+ spec.add_dependency "activeresource", ">= 5", "< 7"
29
30
 
30
31
  spec.add_development_dependency "mutant-rspec", "~> 0.10"
31
32
  spec.add_development_dependency "pry-byebug"
@@ -33,12 +33,13 @@ module Fixably
33
33
  end
34
34
 
35
35
  def expand_association(association)
36
+ association_name = association.to_s.camelize(:lower)
36
37
  relationship = reflections.fetch(association).macro
37
38
  case relationship
38
39
  when :has_one
39
- association
40
+ association_name
40
41
  when :has_many
41
- "#{association}(items)"
42
+ "#{association_name}(items)"
42
43
  else
43
44
  raise ArgumentError, "Unknown relationship, #{relationship}"
44
45
  end
@@ -17,14 +17,14 @@ module Fixably
17
17
 
18
18
  def remove_on_encode = %w[created_at href id]
19
19
 
20
- private
21
-
22
20
  def remove_has_many_associations(attrs)
23
21
  reflections.select { _2.macro.equal?(:has_many) }.keys.each do
24
22
  attrs.delete(_1)
25
23
  end
26
24
  end
27
25
 
26
+ private
27
+
28
28
  def remove_unallowed_parameters(attrs)
29
29
  remove_on_encode.each { attrs.delete(_1) }
30
30
  end
@@ -39,6 +39,15 @@ module Fixably
39
39
  allow_nil: true
40
40
  )
41
41
 
42
+ protected
43
+
44
+ def remove_has_many_associations(attrs)
45
+ reflections.select { |_, reflection| reflection.macro.equal?(:has_many) }.
46
+ keys.
47
+ reject { _1.equal?(:notes) }.
48
+ each { attrs.delete(_1) }
49
+ end
50
+
42
51
  class Contact < ApplicationResource
43
52
  schema do
44
53
  string :full_name
@@ -71,6 +80,8 @@ module Fixably
71
80
  string :text
72
81
  string :type
73
82
  end
83
+
84
+ has_one :created_by, class_name: "fixably/user"
74
85
  end
75
86
 
76
87
  class Task < ApplicationResource
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fixably
4
- VERSION = "0.2.0"
4
+ VERSION = "0.6.0"
5
5
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixably
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Rice
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-13 00:00:00.000000000 Z
11
+ date: 2022-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeresource
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '5'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '7'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '5'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '7'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: mutant-rspec
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -195,6 +201,7 @@ homepage: https://github.com/HashNotAdam/fixably-ruby
195
201
  licenses:
196
202
  - MIT
197
203
  metadata:
204
+ rubygems_mfa_required: 'true'
198
205
  homepage_uri: https://github.com/HashNotAdam/fixably-ruby
199
206
  source_code_uri: https://github.com/HashNotAdam/fixably-ruby
200
207
  post_install_message:
@@ -212,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
219
  - !ruby/object:Gem::Version
213
220
  version: '0'
214
221
  requirements: []
215
- rubygems_version: 3.2.22
222
+ rubygems_version: 3.3.3
216
223
  signing_key:
217
224
  specification_version: 4
218
225
  summary: Ruby client for the Fixably API