lib/devise.rb in devise-4.8.0 vs lib/devise.rb in devise-4.8.1
- old
+ new
@@ -311,15 +311,23 @@
def initialize(name)
@name = name
end
def get
- ActiveSupport::Dependencies.constantize(@name)
+ # TODO: Remove AS::Dependencies usage when dropping support to Rails < 7.
+ if ActiveSupport::Dependencies.respond_to?(:constantize)
+ ActiveSupport::Dependencies.constantize(@name)
+ else
+ @name.constantize
+ end
end
end
def self.ref(arg)
- ActiveSupport::Dependencies.reference(arg)
+ # TODO: Remove AS::Dependencies usage when dropping support to Rails < 7.
+ if ActiveSupport::Dependencies.respond_to?(:reference)
+ ActiveSupport::Dependencies.reference(arg)
+ end
Getter.new(arg)
end
def self.available_router_name
router_name || :main_app