Skip to content

Commit

Permalink
fix bugs in paperclip and state machines compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
stathis-alexander committed Nov 28, 2024
1 parent 7629614 commit 1f4f243
Show file tree
Hide file tree
Showing 10 changed files with 6,170 additions and 48 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ group :development do
gem "rubocop-shopify"
gem "rubocop-sorbet"
gem "rails", "~> 7.2"
gem "state_machines"
end
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
boba (0.0.9)
boba (0.0.11)
sorbet-static-and-runtime (~> 0.5)
tapioca (~> 0.16.4)

Expand Down Expand Up @@ -223,6 +223,7 @@ GEM
prism (>= 0.28.0)
sorbet-static-and-runtime (>= 0.5.10187)
thor (>= 0.19.2)
state_machines (0.6.0)
stringio (3.1.1)
tapioca (0.16.4)
bundler (>= 2.2.25)
Expand Down Expand Up @@ -259,6 +260,7 @@ DEPENDENCIES
rubocop-rspec
rubocop-shopify
rubocop-sorbet
state_machines

RUBY VERSION
ruby 3.3.6p108
Expand Down
5 changes: 5 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Boba History

## 0.0.11

- Dupe Tapioca `StateMachines` compiler and fix bug with abstract classes and preloading instance methods.
- Fix sorting bug in `Paperclip` compiler.

## 0.0.10

- Handle abstract classes in `StateMachinesExtended` better
Expand Down
2 changes: 1 addition & 1 deletion lib/boba/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# frozen_string_literal: true

module Boba
VERSION = "0.0.9"
VERSION = "0.0.11"
end
4 changes: 3 additions & 1 deletion lib/tapioca/dsl/compilers/paperclip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def gather_constants

sig { override.void }
def decorate
attachments = ::Paperclip::AttachmentRegistry.names_for(constant)
# this is a bit awkward, but load order determines the return order here, so sort to ensure consistency across
# all environments.
attachments = ::Paperclip::AttachmentRegistry.names_for(constant).sort
return if attachments.empty?

root.create_path(constant) do |klass|
Expand Down
Loading

0 comments on commit 1f4f243

Please sign in to comment.