From e9631b6933d7ee4cffba952930f7f1bfd0e9f6ad Mon Sep 17 00:00:00 2001 From: Alexander Stathis Date: Sat, 12 Oct 2024 10:41:38 -0400 Subject: [PATCH] fix a bug in compilers that inherit from default tapioca compilers --- Gemfile.lock | 2 +- History.md | 8 +++++++- Makefile | 2 +- lib/boba/version.rb | 2 +- .../dsl/compilers/active_record_associations_persisted.rb | 4 +++- .../dsl/compilers/active_record_columns_persisted.rb | 4 +++- lib/tapioca/dsl/compilers/state_machines_extended.rb | 4 ++-- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2796658..b4eb524 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - boba (0.0.5) + boba (0.0.6) sorbet-static-and-runtime (~> 0.5) tapioca (~> 0.16.2) diff --git a/History.md b/History.md index 687fab7..ee4b521 100644 --- a/History.md +++ b/History.md @@ -1,5 +1,11 @@ # Boba History +## 0.0.6 + +- Fix a bug inheriting from default Tapioca compilers if corresponding Tapioca default compilers don't exist because + the project does not actually use the corresponding DSL or gem. + - Fixes `StateMachinesExtended`, `ActiveRecordAssocationsPersisted`, `ActiveRecordColumnsPersisted` + ## 0.0.5 - Add extended state machines compiler to fix typing on state machines class methods @@ -22,4 +28,4 @@ ## 0.0.0 -Initial Commit +- Initial Commit diff --git a/Makefile b/Makefile index a34b315..752d9de 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ build: .PHONY: clean clean: - rm -r boba-*.gem + rm -fr boba-*.gem .PHONY: docs docs: diff --git a/lib/boba/version.rb b/lib/boba/version.rb index 43b9187..de226c2 100644 --- a/lib/boba/version.rb +++ b/lib/boba/version.rb @@ -2,5 +2,5 @@ # frozen_string_literal: true module Boba - VERSION = "0.0.5" + VERSION = "0.0.6" end diff --git a/lib/tapioca/dsl/compilers/active_record_associations_persisted.rb b/lib/tapioca/dsl/compilers/active_record_associations_persisted.rb index 3798447..239a52e 100644 --- a/lib/tapioca/dsl/compilers/active_record_associations_persisted.rb +++ b/lib/tapioca/dsl/compilers/active_record_associations_persisted.rb @@ -1,7 +1,9 @@ # typed: ignore # frozen_string_literal: true -return unless defined?(ActiveRecord::Base) +require "tapioca/dsl/compilers/active_record_associations" + +return unless defined?(Tapioca::Dsl::Compilers::ActiveRecordAssociations) module Tapioca module Dsl diff --git a/lib/tapioca/dsl/compilers/active_record_columns_persisted.rb b/lib/tapioca/dsl/compilers/active_record_columns_persisted.rb index fadd541..224582f 100644 --- a/lib/tapioca/dsl/compilers/active_record_columns_persisted.rb +++ b/lib/tapioca/dsl/compilers/active_record_columns_persisted.rb @@ -1,7 +1,9 @@ # typed: ignore # frozen_string_literal: true -return unless defined?(ActiveRecord::Base) +require "tapioca/dsl/compilers/active_record_columns" + +return unless defined?(Tapioca::Dsl::Compilers::ActiveRecordColumns) require "tapioca/dsl/helpers/active_record_column_type_helper" diff --git a/lib/tapioca/dsl/compilers/state_machines_extended.rb b/lib/tapioca/dsl/compilers/state_machines_extended.rb index 8a4ce11..b706cf1 100644 --- a/lib/tapioca/dsl/compilers/state_machines_extended.rb +++ b/lib/tapioca/dsl/compilers/state_machines_extended.rb @@ -1,10 +1,10 @@ # typed: ignore # frozen_string_literal: true -return unless defined?(Tapioca) - require "tapioca/dsl/compilers/state_machines" +return unless defined?(Tapioca::Dsl::Compilers::StateMachines) + module Tapioca module Dsl module Compilers