-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop requiring stuff from DSL compilers #1765
Changes from all commits
95a38ee
62ae424
075c20f
9d3a84d
6cb83a7
c2983e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
begin | ||
require "rails" | ||
require "active_record" | ||
require "active_record/fixtures" | ||
require "active_support/test_case" | ||
rescue LoadError | ||
return | ||
end | ||
return unless defined?(Rails) && defined?(ActiveSupport::TestCase) && defined?(ActiveRecord::TestFixtures) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we could define a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that's possible since |
||
|
||
module Tapioca | ||
module Dsl | ||
|
@@ -62,7 +55,7 @@ class << self | |
|
||
sig { override.returns(T::Enumerable[Module]) } | ||
def gather_constants | ||
return [] unless Rails.application | ||
return [] unless defined?(Rails.application) && Rails.application | ||
paracycle marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[ActiveSupport::TestCase] | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was requiring Active Record as well. Does the compiler need
ActiveRecord
to be defined too?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't. I think we were requiring AR to activate the AR support in AASM, but I don't think that's something that is required.
I'll check this again, though.