moves Email model to Verification namespace

This commit is contained in:
Juanjo Bazán
2015-08-29 12:26:20 +02:00
parent 52f57c5b39
commit e33723635b
3 changed files with 4 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ class Verification::EmailController < ApplicationController
skip_authorization_check
def show
if Email.find(current_user, params[:email_verification_token])
if Verification::Email.find(current_user, params[:email_verification_token])
current_user.update(verified_at: Time.now)
redirect_to account_path, notice: t('verification.email.show.flash.success')
else
@@ -13,7 +13,7 @@ class Verification::EmailController < ApplicationController
end
def create
@email = Email.new(@verified_user)
@email = Verification::Email.new(@verified_user)
if @email.save
current_user.reload
Mailer.email_verification(current_user, @email.recipient, @email.encrypted_token).deliver_now

View File

@@ -1,4 +1,4 @@
class Email
class Verification::Email
include ActiveModel::Model
attr_accessor :verified_user, :recipient, :plain_token, :encrypted_token

View File

@@ -1,4 +1,4 @@
<%= form_for Email.new(verified_user), url: email_path, method: :post do |f| %>
<%= form_for Verification::Email.new(verified_user), as: "email", url: email_path, method: :post do |f| %>
<%= hidden_field_tag :recipient, verified_user.email %>
<%= f.submit t('verification.email.form.submit_button') %>
<% end %>