diff --git a/lib/devise.rb b/lib/devise.rb index 429eec6d..9fc667a6 100644 --- a/lib/devise.rb +++ b/lib/devise.rb @@ -243,7 +243,9 @@ module Devise # Set the mailer reference object to access the mailer. def self.mailer=(class_name) - @@mailer_ref = ActiveSupport::Dependencies.reference(class_name) + @@mailer_ref = ActiveSupport::Dependencies.respond_to?(:reference) + ? ActiveSupport::Dependencies.reference(class_name) + : ActiveSupport::Dependencies.ref(class_name) end self.mailer = "Devise::Mailer"