ish_manager 0.1.8.245 → 0.1.8.246

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd7915ad6bfd53231f4546857b3ef2f2888387855d42acfe8bbb69bb2c20dfa7
4
- data.tar.gz: fad21d67cb5a7b3c4bbf69648daa6bc48e0ea07d82d2cf184cc4324142e0a3d0
3
+ metadata.gz: bfffb0ee4f6d94e5697f21cd1583d16831aa4e075a6cb2894952cb6b80d5fddb
4
+ data.tar.gz: 7f827deee207a28c7941436f5b2bb726c5579e45c0eb4fee31c22b1fb267a721
5
5
  SHA512:
6
- metadata.gz: 89c5da23f5ca2628dc6c6d2a6ac5c03edc8625b70b9ca20ccb35db62dfcda630be5c48bbc208df3f39ee746a844ecbb345e4d35a96c53d0f6441463a018b9338
7
- data.tar.gz: 5f57513f152a76464c306f3741b5196eae35630b55bf64d4f6f70583dec4b9067971f5435ab54ea1ff7edf91292803e3cf5bbb6bfb1cdea8f699e2dc78d0daf3
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
- @profile = IshModels::UserProfile.new params[:profile].permit!
44
- authorize! :create, @profile
45
- @profile.user = User.find_or_create_by( :email => params[:profile][:email] )
46
- @profile.user.password ||= (0...12).map { rand(100) }.join
47
- if !@profile.user.save
48
- puts! @profile.user.errors.messages
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}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.245
4
+ version: 0.1.8.246
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox