johnhenry 1.0.10 → 1.0.11
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 +4 -4
- data/app/controllers/johnhenry/payments_controller.rb +3 -3
- data/app/models/john_henry_user.rb +19 -0
- data/app/views/johnhenry/shared/_signin_form.html.haml +1 -1
- data/lib/johnhenry/version.rb +1 -1
- data/lib/tasks/johnhenry_tasks.rake +2 -2
- metadata +2 -2
- data/app/models/user.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f93e7fff2a12bff68441c0db79188fcdd07613cf
|
4
|
+
data.tar.gz: 89a18c14e02a9d9f8cad13941c5c6272eab9cf74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93f52784d4c2a90cb88eaad1d6cccf14bd5c2f5b49ff836b31e8aab51b958bbc954fc6b45ee93ba0f084d0a864707f4fb3c2b3ef14835f58ee1b3e3f83dad5bc
|
7
|
+
data.tar.gz: ab0361fd3a187970178407a0a44c47ddfab574bf0bc4df32308707fca2a47754fe45bdd6eef6ceb2061f515fb6199426d24c8bb71d00918023b841c508967c7e
|
@@ -34,9 +34,9 @@ class Johnhenry::PaymentsController < Johnhenry::ApplicationController
|
|
34
34
|
if params[:email].present?
|
35
35
|
#TODO DRY with other new user generation
|
36
36
|
password = Devise.friendly_token.first(10)
|
37
|
-
user =
|
38
|
-
|
39
|
-
|
37
|
+
user = JohnHenryUser.create! email: params[:email],
|
38
|
+
password: password,
|
39
|
+
password_confirmation: password
|
40
40
|
sign_in(user)
|
41
41
|
else
|
42
42
|
return redirect_to '/', alert: 'You need an account to do that.'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class JohnHenryUser < ActiveRecord::Base
|
2
|
+
self.table_name = 'users'
|
3
|
+
# Include default devise modules. Others available are:
|
4
|
+
# :confirmable, :lockable, :timeoutable and :omniauthable
|
5
|
+
devise :database_authenticatable, :registerable,
|
6
|
+
:recoverable, :rememberable, :trackable, :validatable
|
7
|
+
after_save :send_signup_email
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def send_signup_email
|
12
|
+
if Rails.application.config.respond_to?('send_johnhenry_signup_email') &&
|
13
|
+
Rails.application.config.send_johnhenry_signup_email
|
14
|
+
JohnHenryMailer.signup(self).deliver
|
15
|
+
else
|
16
|
+
Rails.logger.info "Skipped send_signup_email"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/johnhenry/version.rb
CHANGED
@@ -120,8 +120,8 @@ EOS
|
|
120
120
|
code = <<-EOS
|
121
121
|
if Rails.env.development?
|
122
122
|
EmailPreview.register 'Signup' do
|
123
|
-
user =
|
124
|
-
|
123
|
+
user = JohnHenryUser.new email: 'johnny.cage@gmail.com'
|
124
|
+
JohnHenryMailer.signup(user)
|
125
125
|
end
|
126
126
|
end
|
127
127
|
EOS
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: johnhenry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Derewecki
|
@@ -185,8 +185,8 @@ files:
|
|
185
185
|
- app/controllers/johnhenry/sessions_controller.rb
|
186
186
|
- app/helpers/johnhenry/application_helper.rb
|
187
187
|
- app/mailers/john_henry_mailer.rb
|
188
|
+
- app/models/john_henry_user.rb
|
188
189
|
- app/models/payment.rb
|
189
|
-
- app/models/user.rb
|
190
190
|
- app/views/john_henry_mailer/signup.html.haml
|
191
191
|
- app/views/johnhenry/devise/confirmations/new.html.haml
|
192
192
|
- app/views/johnhenry/devise/mailer/confirmation_instructions.html.haml
|
data/app/models/user.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
class User < ActiveRecord::Base
|
2
|
-
# Include default devise modules. Others available are:
|
3
|
-
# :confirmable, :lockable, :timeoutable and :omniauthable
|
4
|
-
devise :database_authenticatable, :registerable,
|
5
|
-
:recoverable, :rememberable, :trackable, :validatable
|
6
|
-
after_save :send_signup_email
|
7
|
-
|
8
|
-
private
|
9
|
-
|
10
|
-
def send_signup_email
|
11
|
-
JohnHenryMailer.signup(self).deliver
|
12
|
-
end
|
13
|
-
end
|