This repository has been archived by the owner on May 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:kaize/nastachku into develop
- Loading branch information
Showing
15 changed files
with
90 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
class UserSignInType | ||
include ActiveModel::Validations | ||
include ActiveModel::Conversion | ||
include Virtus | ||
|
||
attribute :email, String | ||
attribute :password, String | ||
|
||
validates :email, presence: true, email: true | ||
validates :password, presence: true | ||
|
||
validates_each :email do |record, attr, value| | ||
user = record.user | ||
if user.try :new? | ||
record.errors.add(attr, :user_new) | ||
end | ||
|
||
if user.try :inactive? | ||
record.errors.add(attr, :user_inactive) | ||
end | ||
|
||
if !user.try(:authenticate, record.password) | ||
record.errors.add(attr, :user_or_password_invalid) | ||
end | ||
end | ||
|
||
def persisted? | ||
false | ||
end | ||
|
||
def user | ||
@user ||= User.find_by_email(email) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<p>Добрый день, <%= @user.full_name %>.</p> | ||
<p>Ваш почтовый ящик был указан при регистрации на сайте <%= link_to 'nastachku.ru', root_url %>.</p> | ||
<p>Пожалуйста, ПОДТВЕРДИТЕ ВАШУ РЕГИСТРАЦИЮ, пройдя по | ||
<%= link_to 'ссылке', activate_user_url(auth_token: @token.authentication_token) %> | ||
</p> | ||
<p>Не забудьте записать Ваш персональный номер для участия в конференции: <strong><%= @user.id %></strong></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,5 +49,6 @@ ru: | |
user: | ||
attributes: | ||
email: | ||
email: 'Введен некорректный email' | ||
taken: 'Данный Email уже зарегистрирован' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
ru: | ||
user_mailer: | ||
welcome: | ||
subject: "Персональный номер для участия в конференции Стачка" | ||
confirm_registration: | ||
subject: "Подтверждение регистрации" | ||
remind_password: | ||
subject: "Восстановление пароля" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters