Skip to content

Commit 565b091

Browse files
committed
修正 Rails 4.2 Devise 某些功能兼容问题,导致设置界面的删除帐号功能无法使用的问题;
1 parent 190c26f commit 565b091

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ gem 'mongoid_auto_increment_id', '0.6.4'
3333
gem 'mongoid_rails_migrations', '1.0.0'
3434

3535
# 用户系统
36-
gem 'devise', github: "plataformatec/devise", branch: "lm-rails-4-2"
36+
gem 'devise', '~> 3.4.0'
3737
gem 'devise-encryptable', '0.1.2'
3838

3939
# 分页

Gemfile.lock

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
GIT
2-
remote: git://github.com/plataformatec/devise.git
3-
revision: ee69d41fc1707c5b7b2630034dc1d120b6200f56
4-
branch: lm-rails-4-2
5-
specs:
6-
devise (3.3.0)
7-
bcrypt (~> 3.0)
8-
orm_adapter (~> 0.1)
9-
railties (>= 3.2.6, < 5)
10-
responders
11-
thread_safe (~> 0.1)
12-
warden (~> 1.2.3)
13-
141
GEM
152
remote: https://ruby.taobao.org/
163
specs:
@@ -69,7 +56,7 @@ GEM
6956
descendants_tracker (~> 0.0.4)
7057
ice_nine (~> 0.11.0)
7158
thread_safe (~> 0.3, >= 0.3.1)
72-
bcrypt (3.1.7)
59+
bcrypt (3.1.9)
7360
bootstrap-sass (2.3.2.2)
7461
sass (~> 3.2)
7562
bootstrap-will_paginate (0.0.3)
@@ -120,6 +107,13 @@ GEM
120107
database_cleaner (1.3.0)
121108
descendants_tracker (0.0.4)
122109
thread_safe (~> 0.3, >= 0.3.1)
110+
devise (3.4.0)
111+
bcrypt (~> 3.0)
112+
orm_adapter (~> 0.1)
113+
railties (>= 3.2.6, < 5)
114+
responders
115+
thread_safe (~> 0.1)
116+
warden (~> 1.2.3)
123117
devise-encryptable (0.1.2)
124118
devise (>= 2.1.0)
125119
diff-lcs (1.2.5)
@@ -327,7 +321,7 @@ GEM
327321
redis-objects (0.9.1)
328322
redis (>= 3.0.2)
329323
remotipart (1.2.1)
330-
responders (2.0.0)
324+
responders (2.0.1)
331325
railties (>= 4.2.0.alpha, < 5)
332326
rest-client (1.7.2)
333327
mime-types (>= 1.16, < 3.0)
@@ -431,7 +425,7 @@ DEPENDENCIES
431425
coffee-rails (~> 4.0.0)
432426
dalli (= 2.7.1)
433427
database_cleaner
434-
devise!
428+
devise (~> 3.4.0)
435429
devise-encryptable (= 0.1.2)
436430
eventmachine (= 1.0.3)
437431
exception_notification

app/controllers/account_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def destroy
3939

4040
if current_user.valid_password?(current_password)
4141
resource.soft_delete
42-
sign_out_and_redirect(root_path)
42+
sign_out
43+
redirect_to root_path
4344
set_flash_message :notice, :destroyed
4445
else
4546
current_user.errors.add(:current_password, :invalid)

0 commit comments

Comments
 (0)