mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-21 04:38:01 -05:00
Be more friendly if the user goes ahead and adds devise_for :users before defining the model.
This commit is contained in:
@@ -93,6 +93,11 @@ module ActionDispatch::Routing
|
||||
|
||||
begin
|
||||
raise_no_devise_method_error!(mapping.class_name) unless mapping.to.respond_to?(:devise)
|
||||
rescue NameError => e
|
||||
raise unless mapping.class_name == resource.to_s.classify
|
||||
warn "[WARNING] You provided devise_for #{resource.inspect} but there is " <<
|
||||
"no model #{mapping.class_name} defined in your application"
|
||||
next
|
||||
rescue NoMethodError => e
|
||||
raise unless e.message.include?("undefined method `devise'")
|
||||
raise_no_devise_method_error!(mapping.class_name)
|
||||
|
||||
Reference in New Issue
Block a user