boba 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/boba/version.rb +1 -1
- data/lib/tapioca/dsl/compilers/state_machines_extended.rb +37 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e16935e2db06568259ab419c305c0ed064d4fba98c58d4a1f20dab74dd7daa26
|
4
|
+
data.tar.gz: 96a1a1e8220ce8dc7a3e9a7c2a7a9b0c675fbfcf4e0c5544b033889265c3c1e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 246e8b2873276f8e87909aae71dc14143e5635f201246a0b1c9a91a8aa60cec73dfa6e1871672a6e050099f217e646777c0c08a5e9bf5d2ff56cfd71a15de90a
|
7
|
+
data.tar.gz: 9eb1b1c15ba3939c3aec1e76ed83258940d3f3c2afa1f6f054d6189edcbcd65a2f4f853c81a925c2245ed2dd512563eeb689febf7d12fd756f368c2487c20478
|
data/lib/boba/version.rb
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
# typed: ignore
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
return unless defined?(Tapioca)
|
5
|
+
|
6
|
+
require "tapioca/dsl/compilers/state_machines"
|
7
|
+
|
8
|
+
module Tapioca
|
9
|
+
module Dsl
|
10
|
+
module Compilers
|
11
|
+
# `Tapioca::Dsl::Compilers::StateMachinesExtended` extends the default state machines compiler provided by Tapioca
|
12
|
+
# to allow for calling `with_state` and `without_state` on all Active Record relations. This is a temporary fix
|
13
|
+
# until a more durable solution can be found for this type of issue.
|
14
|
+
# See https://github.com/Shopify/tapioca/pull/1994#issuecomment-2302624697.
|
15
|
+
class StateMachinesExtended < ::Tapioca::Dsl::Compilers::StateMachines
|
16
|
+
ACTIVE_RECORD_RELATION_MODULE_NAMES = [
|
17
|
+
"GeneratedRelationMethods",
|
18
|
+
"GeneratedAssociationRelationMethods",
|
19
|
+
].freeze
|
20
|
+
|
21
|
+
def decorate
|
22
|
+
return if constant.state_machines.empty?
|
23
|
+
|
24
|
+
super()
|
25
|
+
|
26
|
+
root.create_path(T.unsafe(constant)) do |klass|
|
27
|
+
class_module_name = "StateMachineClassHelperModule"
|
28
|
+
|
29
|
+
ACTIVE_RECORD_RELATION_MODULE_NAMES.each do |module_name|
|
30
|
+
klass.create_module(module_name).create_include(class_module_name)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Angellist
|
@@ -53,14 +53,15 @@ files:
|
|
53
53
|
- lib/tapioca/dsl/compilers/active_record_associations_persisted.rb
|
54
54
|
- lib/tapioca/dsl/compilers/active_record_columns_persisted.rb
|
55
55
|
- lib/tapioca/dsl/compilers/money_rails.rb
|
56
|
+
- lib/tapioca/dsl/compilers/state_machines_extended.rb
|
56
57
|
homepage: https://github.com/angellist/boba
|
57
58
|
licenses:
|
58
59
|
- MIT
|
59
60
|
metadata:
|
60
61
|
bug_tracker_uri: https://github.com/angellist/boba/issues
|
61
|
-
changelog_uri: https://github.com/angellist/boba/blob/0.0.
|
62
|
+
changelog_uri: https://github.com/angellist/boba/blob/0.0.5/History.md
|
62
63
|
homepage_uri: https://github.com/angellist/boba
|
63
|
-
source_code_uri: https://github.com/angellist/boba/tree/0.0.
|
64
|
+
source_code_uri: https://github.com/angellist/boba/tree/0.0.5
|
64
65
|
rubygems_mfa_required: 'true'
|
65
66
|
post_install_message:
|
66
67
|
rdoc_options: []
|