Closed sudoremo closed 2 years ago
Sorry, for the slow reaction; thanks for the PR.
Sorry, for the slow reaction; thanks for the PR.
No worries @kratob, thanks a lot for merging. Do you have any predictions when 2.3.0 (and therefore this PR) will be pushed to rubygems?
@sudoremo I thought I had released it already, but apparently not. It should be live now.
Many thanks @kratob :)
In
lib/active_type/virtual_attributes.rb
, an alias is created so that the original ActiveRecord methodattribute
still can be used:The problem is that, since this is an
ActiveSupport::Concern
, theClassMethods
-Module which contains the newattribute
method is mixed in before the aliassing happens. This effectively aliases the ActiveTypeattribute
to itself - at least with Ruby 3 and Rails 7.This PR attempts to fix this by renaming the overriding method
attribute
toat_attribute
and performing a second alias operation.Many thanks for having a look at this 👍 🎆