Closed aalong-tr closed 5 months ago
Thanks for the issue. I believe Rails 6.1 will be EOL soon so I'm not sure if we should support this out of the box. In the meantime feel free to override the method and remove the reference in your application.
For now, placing this in e.g. your config/application.rb
file fixes the issue:
# https://github.com/Shopify/tapioca/issues/1913
module ActiveRecord
module Encryption
class EncryptedAttributeType; end # rubocop:disable Lint/EmptyClass
end
end
Dropping support for a Rails version (that is not EOL since a long time) might be worth a major version jump?
@swiknaba Rails 6.1 has been EOL since Rails 7.1 was released in October 2023 based on the maintenance policy of Rails:
The current release series and the next most recent one will receive patches and new versions in case of a security issue.
The core team has chosen to continue doing security releases for 6.1 series, as an exception, but that doesn't mean it is a supported version.
Tapioca follows the Rails and Ruby support schedules very closely, we drop official support for any versions that are no longer supported.
We enforce minimum versions of Ruby using the required_ruby_version
in the gemspec, and we could do something similar to the versions of Rails that we support (via a runtime check, though) and refuse to generate any Rails related DSL RBIs if the version doesn't match.
We have opted to not do that, and to allow folks on older Ruby versions to be able to use Tapioca, but we won't be testing against older versions and, thus, support for them is best effort.
Repo with simple reproduction here: https://github.com/aalong-tr/tapioca-rails-6-encryption
Tapioca version 0.14.3 includes improvements from #1904 to better handle Rails 7 encrypted attribute behaviors. Unfortunately this logic references a constant that does not exist on Rails 6. As a result, the
tapioca dsl
command run against a Rails 6.1 application produces the error: