From 30b35e372754fd0f9f8ee2c58845c567e73aa469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 24 Mar 2011 20:25:54 +0100 Subject: [PATCH] Fix syntax error. --- lib/devise.rb | 10 +++++++--- lib/devise/mapping.rb | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/devise.rb b/lib/devise.rb index 9fc667a6..b9d2bb05 100644 --- a/lib/devise.rb +++ b/lib/devise.rb @@ -226,6 +226,12 @@ module Devise yield self end + def self.ref(arg) + dependencies = ActiveSupport::Dependencies + dependencies.respond_to?(:reference) ? + dependencies.reference(arg) : dependencies.ref(arg) + end + def self.omniauth_providers omniauth_configs.keys end @@ -243,9 +249,7 @@ module Devise # Set the mailer reference object to access the mailer. def self.mailer=(class_name) - @@mailer_ref = ActiveSupport::Dependencies.respond_to?(:reference) - ? ActiveSupport::Dependencies.reference(class_name) - : ActiveSupport::Dependencies.ref(class_name) + @@mailer_ref = ref(class_name) end self.mailer = "Devise::Mailer" diff --git a/lib/devise/mapping.rb b/lib/devise/mapping.rb index 8a1d25ff..3f6d275e 100644 --- a/lib/devise/mapping.rb +++ b/lib/devise/mapping.rb @@ -50,7 +50,7 @@ module Devise @singular = (options[:singular] || @scoped_path.tr('/', '_').singularize).to_sym @class_name = (options[:class_name] || name.to_s.classify).to_s - @ref = ActiveSupport::Dependencies.ref(@class_name) + @ref = Devise.ref(@class_name) @path = (options[:path] || name).to_s @path_prefix = options[:path_prefix]