activerecord-ejection_seat 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.tool-versions +1 -1
  4. data/CODE_OF_CONDUCT.md +1 -1
  5. data/Gemfile.lock +30 -30
  6. data/README.md +19 -8
  7. data/activerecord-ejection_seat.gemspec +3 -3
  8. data/lib/activerecord-ejection_seat/version.rb +1 -1
  9. data/sorbet/rbi/gems/{activemodel@7.0.4.1.rbi → activemodel@7.0.4.2.rbi} +0 -0
  10. data/sorbet/rbi/gems/{activerecord@7.0.4.1.rbi → activerecord@7.0.4.2.rbi} +128 -128
  11. data/sorbet/rbi/gems/{activesupport@7.0.4.1.rbi → activesupport@7.0.4.2.rbi} +1 -1
  12. data/sorbet/rbi/gems/{concurrent-ruby@1.1.10.rbi → concurrent-ruby@1.2.0.rbi} +1158 -1220
  13. data/sorbet/rbi/gems/irb@1.6.2.rbi +35 -50
  14. data/sorbet/rbi/gems/{language_server-protocol@3.17.0.2.rbi → language_server-protocol@3.17.0.3.rbi} +0 -0
  15. data/sorbet/rbi/gems/{parser@3.2.0.0.rbi → parser@3.2.1.0.rbi} +596 -307
  16. data/sorbet/rbi/gems/{regexp_parser@2.6.1.rbi → regexp_parser@2.7.0.rbi} +598 -144
  17. data/sorbet/rbi/gems/{rubocop-ast@1.24.1.rbi → rubocop-ast@1.26.0.rbi} +94 -94
  18. data/sorbet/rbi/gems/{rubocop-minitest@0.26.1.rbi → rubocop-minitest@0.27.0.rbi} +111 -45
  19. data/sorbet/rbi/gems/{rubocop-sorbet@0.6.11.rbi → rubocop-sorbet@0.7.0.rbi} +158 -114
  20. data/sorbet/rbi/gems/{rubocop@1.43.0.rbi → rubocop@1.45.1.rbi} +1339 -954
  21. data/sorbet/rbi/gems/{ruby-lsp@0.3.8.rbi → ruby-lsp@0.4.0.rbi} +0 -0
  22. data/sorbet/rbi/gems/{syntax_tree@5.2.0.rbi → syntax_tree@6.0.0.rbi} +0 -0
  23. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5917 -0
  24. metadata +22 -22
  25. data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8cb74f8d55bb740891ac604fbb974cbbc78ce7e01bd67eb739a01cd4cdae756
4
- data.tar.gz: c14a4d5a2382acda29d63c3a77bbf0e4080eff154e3b6cccfb4b91aa13b120e1
3
+ metadata.gz: d37d5dedef56e4a743bb6b979dfcd53d8e8adaa5dfe7aad1edf3431aea18c987
4
+ data.tar.gz: a574c315f0b1578a84115e7702bf3613dd01eab053b1a4b6da72186e9aab585e
5
5
  SHA512:
6
- metadata.gz: e4f736acf5cf15bab547d35f2cf4c21963a6a188029df0c23f59dbbbc900ef7474f0de67013ccac7afa853d832f5fb839e0503019b37a90a2508cab7ce0def55
7
- data.tar.gz: 787f28eaa9428fbe03e6d48be126d591af896da66e4a360c250e9d9b70ae9d3a03505f66134b53e6ba8be927cbced95b52fd12d2e8a288e582a9189618d307e6
6
+ metadata.gz: bd053a38351b5e7b8310f87a57338e2b08403a7a17f1976171699b672d005bb106b24e87daaea22f4fa090cde35f4d3205571575f075ea9ea16d8a2870d40434
7
+ data.tar.gz: ad848b3caaf2faed99b6d6d28f4530dc441c6cce7f7001af4d8131b0de94e35443bb7df54d59d3dd0505cfd94e04cf51ffb1c4c100a624087f5628da3d384625
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.0
1
+ 3.2.1
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.2.0
1
+ ruby 3.2.1
data/CODE_OF_CONDUCT.md CHANGED
@@ -39,7 +39,7 @@ This Code of Conduct applies within all community spaces, and also applies when
39
39
 
40
40
  ## Enforcement
41
41
 
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at max@audaciousaardvark.com. All complaints will be reviewed and investigated promptly and fairly.
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at maxveldink@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
43
 
44
44
  All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
45
 
data/Gemfile.lock CHANGED
@@ -1,25 +1,25 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activerecord-ejection_seat (0.3.0)
4
+ activerecord-ejection_seat (0.3.1)
5
5
  activerecord (>= 6.0)
6
6
  sorbet-runtime
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activemodel (7.0.4.1)
12
- activesupport (= 7.0.4.1)
13
- activerecord (7.0.4.1)
14
- activemodel (= 7.0.4.1)
15
- activesupport (= 7.0.4.1)
16
- activesupport (7.0.4.1)
11
+ activemodel (7.0.4.2)
12
+ activesupport (= 7.0.4.2)
13
+ activerecord (7.0.4.2)
14
+ activemodel (= 7.0.4.2)
15
+ activesupport (= 7.0.4.2)
16
+ activesupport (7.0.4.2)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
18
  i18n (>= 1.6, < 2)
19
19
  minitest (>= 5.1)
20
20
  tzinfo (~> 2.0)
21
21
  ast (2.4.2)
22
- concurrent-ruby (1.1.10)
22
+ concurrent-ruby (1.2.0)
23
23
  debug (1.7.1)
24
24
  irb (>= 1.5.0)
25
25
  reline (>= 0.3.1)
@@ -30,11 +30,11 @@ GEM
30
30
  irb (1.6.2)
31
31
  reline (>= 0.3.0)
32
32
  json (2.6.3)
33
- language_server-protocol (3.17.0.2)
33
+ language_server-protocol (3.17.0.3)
34
34
  minitest (5.17.0)
35
35
  netrc (0.11.0)
36
36
  parallel (1.22.1)
37
- parser (3.2.0.0)
37
+ parser (3.2.1.0)
38
38
  ast (~> 2.4.1)
39
39
  prettier_print (1.2.0)
40
40
  rainbow (3.1.1)
@@ -44,11 +44,11 @@ GEM
44
44
  parser (>= 2.6.4.0)
45
45
  sorbet-runtime (>= 0.5.9204)
46
46
  unparser
47
- regexp_parser (2.6.1)
47
+ regexp_parser (2.7.0)
48
48
  reline (0.3.2)
49
49
  io-console (~> 0.5)
50
50
  rexml (3.2.5)
51
- rubocop (1.43.0)
51
+ rubocop (1.45.1)
52
52
  json (~> 2.3)
53
53
  parallel (~> 1.10)
54
54
  parser (>= 3.2.0.0)
@@ -58,28 +58,28 @@ GEM
58
58
  rubocop-ast (>= 1.24.1, < 2.0)
59
59
  ruby-progressbar (~> 1.7)
60
60
  unicode-display_width (>= 2.4.0, < 3.0)
61
- rubocop-ast (1.24.1)
62
- parser (>= 3.1.1.0)
63
- rubocop-minitest (0.26.1)
61
+ rubocop-ast (1.26.0)
62
+ parser (>= 3.2.1.0)
63
+ rubocop-minitest (0.27.0)
64
64
  rubocop (>= 0.90, < 2.0)
65
65
  rubocop-rake (0.6.0)
66
66
  rubocop (~> 1.0)
67
- rubocop-sorbet (0.6.11)
67
+ rubocop-sorbet (0.7.0)
68
68
  rubocop (>= 0.90.0)
69
- ruby-lsp (0.3.8)
69
+ ruby-lsp (0.4.0)
70
70
  language_server-protocol (~> 3.17.0)
71
71
  sorbet-runtime
72
- syntax_tree (>= 5.0.0, < 6)
72
+ syntax_tree (>= 6, < 7)
73
73
  ruby-progressbar (1.11.0)
74
- sorbet (0.5.10626)
75
- sorbet-static (= 0.5.10626)
76
- sorbet-runtime (0.5.10626)
77
- sorbet-static (0.5.10626-universal-darwin-21)
78
- sorbet-static (0.5.10626-universal-darwin-22)
79
- sorbet-static (0.5.10626-x86_64-linux)
80
- sorbet-static-and-runtime (0.5.10626)
81
- sorbet (= 0.5.10626)
82
- sorbet-runtime (= 0.5.10626)
74
+ sorbet (0.5.10676)
75
+ sorbet-static (= 0.5.10676)
76
+ sorbet-runtime (0.5.10676)
77
+ sorbet-static (0.5.10676-universal-darwin-21)
78
+ sorbet-static (0.5.10676-universal-darwin-22)
79
+ sorbet-static (0.5.10676-x86_64-linux)
80
+ sorbet-static-and-runtime (0.5.10676)
81
+ sorbet (= 0.5.10676)
82
+ sorbet-runtime (= 0.5.10676)
83
83
  sorbet-struct-comparable (1.3.0)
84
84
  sorbet-runtime (>= 0.5)
85
85
  spoom (1.1.15)
@@ -88,7 +88,7 @@ GEM
88
88
  thor (>= 0.19.2)
89
89
  sqlite3 (1.6.0-arm64-darwin)
90
90
  sqlite3 (1.6.0-x86_64-linux)
91
- syntax_tree (5.2.0)
91
+ syntax_tree (6.0.0)
92
92
  prettier_print (>= 1.2.0)
93
93
  tapioca (0.10.5)
94
94
  bundler (>= 1.17.3)
@@ -100,7 +100,7 @@ GEM
100
100
  thor (>= 1.2.0)
101
101
  yard-sorbet
102
102
  thor (1.2.1)
103
- tzinfo (2.0.5)
103
+ tzinfo (2.0.6)
104
104
  concurrent-ruby (~> 1.0)
105
105
  unicode-display_width (2.4.2)
106
106
  unparser (0.6.7)
@@ -136,4 +136,4 @@ DEPENDENCIES
136
136
  tapioca
137
137
 
138
138
  BUNDLED WITH
139
- 2.4.4
139
+ 2.4.7
data/README.md CHANGED
@@ -20,7 +20,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
20
20
 
21
21
  ## Usage
22
22
 
23
- Let's say you have an `ActiveRecord` model for a `User` with a string `name` column, an integer `age` column and a `role` enum column. Another way to express this would be a `User` type that is a simple, typed struct.
23
+ Let's say you have an `ActiveRecord` model for a `User` with a string `name` column, an integer `age` column, a `role` enum column and a belongs to association with a `Location` model. Another way to express this would be a `User` type that is a simple, typed struct with other supporting structs.
24
24
 
25
25
  ```ruby
26
26
  module Types
@@ -31,10 +31,15 @@ module Types
31
31
  end
32
32
  end
33
33
 
34
+ class Location < T::Struct
35
+ const :name, String
36
+ end
37
+
34
38
  class User < T::Struct
35
39
  const :name, String
36
40
  const :age, Integer
37
41
  const :role, UserRoles
42
+ const :location, Location
38
43
  end
39
44
  end
40
45
  ```
@@ -43,6 +48,7 @@ In our model, we can specify an ejection to this type.
43
48
 
44
49
  ```ruby
45
50
  class User
51
+ belongs_to :location
46
52
  enum :role, { admin: "admin", member: "member" }
47
53
 
48
54
  ejects_to Types::User
@@ -52,17 +58,18 @@ end
52
58
  Now, we have two new methods available on `User`. First, we can eject from a `User` instance to a `Types::User`.
53
59
 
54
60
  ```ruby
55
- User.new(name: "Max", age: 28, role: "admin").eject
56
- # => Types::User(name: "Max", age: 28, role: Types::UserRoles::Admin)
57
- User.new(name: "Max", age: 28, role: "admin").to_struct # alias
61
+ location = Location.new(name: "Florida")
62
+ User.new(name: "Max", age: 28, role: "admin", location: location).eject
63
+ # => Types::User(name: "Max", age: 28, role: Types::UserRoles::Admin, location: Types::Location.new(name: "Florida))
64
+ User.new(name: "Max", age: 28, role: "admin", location: location).to_struct # alias
58
65
  ```
59
66
 
60
67
  Second, we can buckle into the `User` model with a `Types::User`.
61
68
 
62
69
  ```ruby
63
- user_struct = Types::User.new(name: "Max", age: 28, role: Types::UserRoles::Admin)
70
+ user_struct = Types::User.new(name: "Max", age: 28, role: Types::UserRoles::Admin, location: Types::Location.new(name: "Florida"))
64
71
  User.buckle(user_struct)
65
- # => User(name: "Max", age: 28, role: "admin")
72
+ # => User(name: "Max", age: 28, role: "admin", location: Location(name: "Florida"))
66
73
  User.from_struct(user_struct) # alias
67
74
  ```
68
75
 
@@ -74,7 +81,7 @@ To install this gem onto your local machine, run `bundle exec rake install`.
74
81
 
75
82
  ## Contributing
76
83
 
77
- Bug reports and pull requests are welcome on GitHub at https://github.com/audaciousaardvark/activerecord-ejection_seat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/audaciousaardvark/activerecord-ejection_seat/blob/master/CODE_OF_CONDUCT.md).
84
+ Bug reports and pull requests are welcome on GitHub at https://github.com/maxveldink/activerecord-ejection_seat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/maxveldink/activerecord-ejection_seat/blob/master/CODE_OF_CONDUCT.md).
78
85
 
79
86
  ## License
80
87
 
@@ -82,4 +89,8 @@ The gem is available as open source under the terms of the [MIT License](https:/
82
89
 
83
90
  ## Code of Conduct
84
91
 
85
- Everyone interacting in this project's codebase, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/audaciousaardvark/activerecord-ejection_seat/blob/master/CODE_OF_CONDUCT.md).
92
+ Everyone interacting in this project's codebase, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/maxveldink/activerecord-ejection_seat/blob/master/CODE_OF_CONDUCT.md).
93
+
94
+ ## Sponsorships
95
+
96
+ I love creating in the open. If you find this or any other [maxveld.ink](https://maxveld.ink) content useful, please consider sponsoring me on [GitHub](https://github.com/sponsors/maxveldink).
@@ -6,14 +6,14 @@ Gem::Specification.new do |spec|
6
6
  spec.name = "activerecord-ejection_seat"
7
7
  spec.version = ActiveRecord::EjectionSeat::VERSION
8
8
  spec.authors = ["Max VelDink"]
9
- spec.email = ["max@audaciousaardvark.com"]
9
+ spec.email = ["maxveldink@gmail.com"]
10
10
 
11
11
  spec.summary = "Eject from an ActiveRecord model to a Sorbet T::Struct, or buckle back in."
12
12
  spec.description = "When working with ActiveRecord models, sometimes you want to eject to a simpler, safer object. \
13
13
  Enter Sorbet's T::Struct. This gem makes it much easier to target a \
14
14
  Sorbet T::Struct and eject from an ActiveRecord model into the struct. \
15
15
  It also allows you to buckle in from a simple struct to a new ActiveRecord model instance."
16
- spec.homepage = "https://github.com/AudaciousAardvark/activerecord-ejection_seat"
16
+ spec.homepage = "https://github.com/maxveldink/activerecord-ejection_seat"
17
17
  spec.license = "MIT"
18
18
  spec.required_ruby_version = ">= 3.0.0"
19
19
 
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.metadata["homepage_uri"] = spec.homepage
24
24
  spec.metadata["source_code_uri"] = spec.homepage
25
- spec.metadata["changelog_uri"] = "https://github.com/AudaciousAardvark/activerecord-ejection_seat/blob/main/CHANGELOG.md"
25
+ spec.metadata["changelog_uri"] = "https://github.com/maxveldink/activerecord-ejection_seat/blob/main/CHANGELOG.md"
26
26
 
27
27
  # Specify which files should be added to the gem when it is released.
28
28
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -3,6 +3,6 @@
3
3
 
4
4
  module ActiveRecord
5
5
  module EjectionSeat
6
- VERSION = "0.3.0"
6
+ VERSION = "0.3.1"
7
7
  end
8
8
  end