ish_manager 0.1.8.245 → 0.1.8.246
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfffb0ee4f6d94e5697f21cd1583d16831aa4e075a6cb2894952cb6b80d5fddb
|
4
|
+
data.tar.gz: 7f827deee207a28c7941436f5b2bb726c5579e45c0eb4fee31c22b1fb267a721
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54239a3209466e3fd8d1310c0ddd4d43dce82da82b38e4870862a8553d7f9ef9c7723e5a4875232987796ddecb0ab20830d834a05871c1ac453205367006e17a
|
7
|
+
data.tar.gz: 9354d473aa127c4de7f52623a2dbffeddd863d86c34b077a1fe91e8363a93d4a3cf49d43cc594f1cbb11ca8958cfc4f6bb06f3de0431c153242adbe70168708b
|
@@ -40,15 +40,14 @@ class IshManager::UserProfilesController < IshManager::ApplicationController
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def create
|
43
|
-
@
|
44
|
-
|
45
|
-
@profile
|
46
|
-
@
|
47
|
-
if !@
|
48
|
-
|
49
|
-
raise 'cannot save profile.user'
|
43
|
+
@user = User.find_or_create_by( :email => params[:profile][:email] )
|
44
|
+
@user.password ||= (0...12).map { rand(100) }.join
|
45
|
+
@user.profile = IshModels::UserProfile.new params[:profile].permit!
|
46
|
+
authorize! :create, @user.profile
|
47
|
+
if !@user.save
|
48
|
+
raise "cannot save profile.user: #{@profile.user.errors.full_messages} profile errors: #{@profile.errors.full_messages}"
|
50
49
|
end
|
51
|
-
if @profile.save
|
50
|
+
if @user.profile.save
|
52
51
|
flash[:notice] = "Created profile"
|
53
52
|
else
|
54
53
|
flash[:alert] = "Cannot create profile: #{@profile.errors.messages}"
|