tienda 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/tienda/users_controller.rb +5 -7
- data/lib/tienda/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 731275b6c8beefea44889b34597732c9dfbcc4b0
|
4
|
+
data.tar.gz: 9b55af96fd3b8af48430dc3b6245184bb6648c22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8a7feb4833e37768c7a70c4a03bc76786d51592117ed77256f308c3f7eda9e7d4cf0dcab6c9a64e51be14496a91ec0bc3d979421e01126f7b2a89a8e413c4a5
|
7
|
+
data.tar.gz: de0a16ab7e693d1a357eec0795de9afb3a92ecd6c890a6dfbccc42928aa317484930bb4c3e0a8cc6247c414ea5604434564a54d7bfdea18e226905acd805691c
|
@@ -1,11 +1,10 @@
|
|
1
1
|
module Tienda
|
2
2
|
class UsersController < Tienda::ApplicationController
|
3
|
-
|
4
3
|
before_filter { @active_nav = :users }
|
5
4
|
before_filter { params[:id] && @user = Tienda::User.find(params[:id]) }
|
6
5
|
before_filter(only: [:create, :update, :destroy]) do
|
7
6
|
if Tienda.settings.demo_mode?
|
8
|
-
|
7
|
+
fail Tienda::Error, t('tienda.users.demo_mode_error')
|
9
8
|
end
|
10
9
|
end
|
11
10
|
|
@@ -22,7 +21,7 @@ module Tienda
|
|
22
21
|
if @user.save
|
23
22
|
redirect_to :users, flash: { notice: t('tienda.users.create_notice') }
|
24
23
|
else
|
25
|
-
render action:
|
24
|
+
render action: 'new'
|
26
25
|
end
|
27
26
|
end
|
28
27
|
|
@@ -31,14 +30,14 @@ module Tienda
|
|
31
30
|
|
32
31
|
def update
|
33
32
|
if @user.update(safe_params)
|
34
|
-
redirect_to [:edit, @user], flash: { notice t('tienda.users.update_notice') }
|
33
|
+
redirect_to [:edit, @user], flash: { notice: t('tienda.users.update_notice') }
|
35
34
|
else
|
36
|
-
render action:
|
35
|
+
render action: 'edit'
|
37
36
|
end
|
38
37
|
end
|
39
38
|
|
40
39
|
def destroy
|
41
|
-
|
40
|
+
fail Tienda::Error, t('tienda.users.self_remove_error') if @user == current_user
|
42
41
|
@user.destroy
|
43
42
|
redirect_to :users, flash: { notice: t('tienda.users.destroy_notice') }
|
44
43
|
end
|
@@ -48,6 +47,5 @@ module Tienda
|
|
48
47
|
def safe_params
|
49
48
|
params[:user].permit(:first_name, :last_name, :email_address, :password, :password_confirmation)
|
50
49
|
end
|
51
|
-
|
52
50
|
end
|
53
51
|
end
|
data/lib/tienda/version.rb
CHANGED