unit-ruby 0.3.7 → 0.4.0

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: 85cc2b45531a2209cca9996808adf08499c99ca20c7c46ffa2546199b2233970
4
- data.tar.gz: f7aa80fa8ef3ba7f96ed2f508ec4da0a53f76414d239ecb66b495831affea55c
3
+ metadata.gz: 7417620acf3f69df5f634207b4bf0e97d5a7e45aca790ce22b57aa2d8fd84614
4
+ data.tar.gz: 11cbabcdb449614599cf252f7ea514b931a6ba7568efec791a11d053f32df866
5
5
  SHA512:
6
- metadata.gz: d8b539b90bc395e4437dc85d31f5653b2c9b27b304205f882eaae923028e4edf6b6f8c6b56c3ceb241dadbbaaa8577fb76bdb08bb6057c3ec514e20633401c6e
7
- data.tar.gz: e283b5244f7b8692f2c37d4418c03bbbdbc614daa9e8f7956745744530f9d85ea6761c8756a87e9db1180eeb109ff6efbdc657795a0847919f43bc8b9e058a8d
6
+ metadata.gz: ce872f36d6ec31367d22ef794ca47d88748bcc051d92b8000715cf5c011193f8f9ea48e4c898dd46bb1a8710bdd50b330eee0a37cd7b12e2eb049023b67c89be
7
+ data.tar.gz: 48665a1223b85b440e4b4d0fdbb4af7008f9209f95d29b0c4cd9e9d15cd9a94b2248475b36d8b565ee616dfa387f29f3315223203a2a0e5659d808ebce40cc28
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unit-ruby (0.3.7)
4
+ unit-ruby (0.4.0)
5
5
  activesupport (>= 6.1.5, < 7.1.0)
6
6
  faraday (~> 1.8.0)
7
7
  faraday_middleware (~> 1.0.0)
data/README.md CHANGED
@@ -45,12 +45,11 @@ In order to publish this gem on [RubyGems.org](https://rubygems.org/), you will
45
45
 
46
46
  Once your account is set up, the following operations will facilitate publishing the latest version of the gem:
47
47
 
48
- 1. Ensure that PR request is approved by appropriate member(s) of the engineering team
49
- 2. Update the gem version number in `version.rb`
48
+ 1. After making your changes to the gem, update the version number in `version.rb` and open a PR for review using semantic versioning
49
+ 2. Ensure that PR request is approved by appropriate member(s) of the engineering team before publishing the gem in the below steps
50
50
  3. Run `gem build unit-ruby`. This will build a version of the gem called `unit-ruby-[gem version number].gem`
51
51
  4. Push this latest version of the gem to RubyGems.org by calling `gem push unit-ruby-[gem version number].gem`
52
- 5. Commit `version.rb` file
53
- 6. Merge PR into `main` branch
52
+ 5. Merge PR into `main` branch
54
53
 
55
54
  ## Contributing
56
55
 
@@ -124,6 +124,16 @@ module Unit
124
124
  [send(singular_resource_name)].compact
125
125
  end
126
126
  end
127
+
128
+ define_method("#{resource_name}=") do |resources|
129
+ singular_resource_name = resource_name.to_s.singularize.to_sym
130
+
131
+ relationships[resource_name] = {
132
+ data: resources.map do |resource|
133
+ { type: singular_resource_name, id: resource.id }
134
+ end
135
+ }
136
+ end
127
137
  end
128
138
 
129
139
  # Hyrdates an instance of the resource from data returned from the API
@@ -1,3 +1,3 @@
1
1
  module Unit
2
- VERSION = '0.3.7'
2
+ VERSION = '0.4.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unit-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chloe Isacke
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-09-07 00:00:00.000000000 Z
12
+ date: 2023-09-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport