mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Deprecated support for nested devise_for blocks
This commit is contained in:
parent
d8656427fd
commit
55be93d5c4
5 changed files with 9 additions and 11 deletions
|
@ -16,6 +16,7 @@ Notes: https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.
|
|||
* deprecation
|
||||
* Move devise/shared/_links.erb to devise/_links.erb
|
||||
* Devise only supports Rails 3.1 forward
|
||||
* Deprecated support for nested devise_for blocks
|
||||
|
||||
== 2.0.0.rc
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ GEM
|
|||
rack-openid (~> 1.3.1)
|
||||
orm_adapter (0.0.5)
|
||||
polyglot (0.3.3)
|
||||
rack (1.4.0)
|
||||
rack (1.4.1)
|
||||
rack-cache (1.1)
|
||||
rack (>= 0.4)
|
||||
rack-openid (1.3.1)
|
||||
|
|
|
@ -208,7 +208,12 @@ module ActionDispatch::Routing
|
|||
routes = mapping.used_routes
|
||||
|
||||
devise_scope mapping.name do
|
||||
yield if block_given?
|
||||
if block_given?
|
||||
ActiveSupport::Deprecation.warn "Passing a block to devise_for is deprecated. " \
|
||||
"Please call devise_scope :#{mapping.name} do ... end with the block instead", caller
|
||||
yield
|
||||
end
|
||||
|
||||
with_devise_exclusive_scope mapping.fullpath, mapping.name, options do
|
||||
routes.each { |mod| send("devise_#{mod}", mapping, mapping.controllers) }
|
||||
end
|
||||
|
|
|
@ -435,12 +435,6 @@ class AuthenticationOthersTest < ActionController::IntegrationTest
|
|||
assert_not warden.authenticated?(:admin)
|
||||
end
|
||||
|
||||
test 'uses the mapping from nested devise_for call' do
|
||||
sign_in_as_user :visit => "/devise_for/sign_in"
|
||||
assert warden.authenticated?(:user)
|
||||
assert_not warden.authenticated?(:admin)
|
||||
end
|
||||
|
||||
test 'sign in with xml format returns xml response' do
|
||||
create_user
|
||||
post user_session_path(:format => 'xml'), :user => {:email => "user@test.com", :password => '123456'}
|
||||
|
|
|
@ -12,9 +12,7 @@ Rails.application.routes.draw do
|
|||
resources :admins, :only => [:index]
|
||||
|
||||
# Users scope
|
||||
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } do
|
||||
match "/devise_for/sign_in", :to => "devise/sessions#new"
|
||||
end
|
||||
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
|
||||
|
||||
as :user do
|
||||
match "/as/sign_in", :to => "devise/sessions#new"
|
||||
|
|
Loading…
Reference in a new issue