Browse files

No need to finalize Devise helpers all the time, closes #1317

  • Loading branch information...
1 parent 1b5d0af commit dd36324756b6b3027444db545bc1875f5d2d4b4c @josevalim josevalim committed Sep 8, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/devise/rails/routes.rb
View
9 lib/devise/rails/routes.rb
@@ -4,8 +4,12 @@ class RouteSet #:nodoc:
# need devise_for mappings already declared to create filters and helpers.
def finalize_with_devise!
finalize_without_devise!
- Devise.configure_warden!
- Devise.regenerate_helpers!
+
+ @devise_finalized ||= begin
+ Devise.configure_warden!
+ Devise.regenerate_helpers!
+ true
+ end
end
alias_method_chain :finalize!, :devise
end
@@ -169,6 +173,7 @@ class Mapper
# end
#
def devise_for(*resources)
+ @devise_finalized = false
options = resources.extract_options!
options[:as] ||= @scope[:as] if @scope[:as].present?

0 comments on commit dd36324

Please sign in to comment.