Skip to content

Commit

Permalink
support abstract classes with state machines
Browse files Browse the repository at this point in the history
  • Loading branch information
stathis-alexander committed Nov 27, 2024
1 parent c1c3c05 commit 7629614
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Boba History

## 0.0.10

- Handle abstract classes in `StateMachinesExtended` better

## 0.0.9

- Added `AttrJson` compiler
Expand Down
2 changes: 2 additions & 0 deletions lib/tapioca/dsl/compilers/state_machines_extended.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class StateMachinesExtended < ::Tapioca::Dsl::Compilers::StateMachines
].freeze

def decorate
# This should really get checked at the gather_constants level but here we are...
return if T::AbstractUtils.abstract_module?(constant)
return if constant.state_machines.empty?

# This is a hack to make sure the instance methods are defined on the constant. Somehow the constant is being
Expand Down

0 comments on commit 7629614

Please sign in to comment.