johnhenry 1.0.10 → 1.0.11

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
  SHA1:
3
- metadata.gz: 05d53368c408ca617aca46bd92678b3a420cc813
4
- data.tar.gz: 9bd02164dcb22881191deedda0fb67646fc3610f
3
+ metadata.gz: f93e7fff2a12bff68441c0db79188fcdd07613cf
4
+ data.tar.gz: 89a18c14e02a9d9f8cad13941c5c6272eab9cf74
5
5
  SHA512:
6
- metadata.gz: 07e9831345a739a24f31295cb1aa9454c0bc3a96e01d462ee50f73f9c93b2561353ca16c91979478e99f4559d01eec633c9c038eeb86916670885305efc611d0
7
- data.tar.gz: 0c934d4871835a87aae74f802b79743f19b08bb9eb30c49777de4ce434d8bc5f930d285b290052ddf4fd0945a8d3301001029b686028085803bb53e9ebf0a391
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 = User.create! email: params[:email],
38
- password: password,
39
- password_confirmation: password
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
@@ -1,4 +1,4 @@
1
- = form_for(User.new,
1
+ = form_for(JohnHenryUser.new,
2
2
  as: :user,
3
3
  url: session_path(:user),
4
4
  class: 'require-validation') do |f|
@@ -1,3 +1,3 @@
1
1
  module JohnHenry
2
- VERSION = '1.0.10'
2
+ VERSION = '1.0.11'
3
3
  end
@@ -120,8 +120,8 @@ EOS
120
120
  code = <<-EOS
121
121
  if Rails.env.development?
122
122
  EmailPreview.register 'Signup' do
123
- user = User.new email: 'johnny.cage@gmail.com'
124
- UserMailer.signup(user)
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.10
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
@@ -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