New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new field contacts in resume #501
Conversation
@usernaimandrey deploy demo, please. |
@@ -0,0 +1,5 @@ | |||
class AddContactPhoneToResumes < ActiveRecord::Migration[7.0] | |||
def change | |||
add_column :resumes, :contact_phone, :string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Наверное моно было в одну миграцию забубенить (хотя и не важно)
@@ -19,6 +19,7 @@ class Resume < ApplicationRecord | |||
validates :github_url, presence: true | |||
validates :summary, presence: true, length: { minimum: 200 } | |||
validates :skills_description, presence: true | |||
validates :contact_email, 'valid_email_2/email': true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может надо добавить еще и валидацию телефона?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
да добавил
app/forms/web/admin/resume_form.rb
Outdated
@@ -3,7 +3,7 @@ | |||
class Web::Admin::ResumeForm < Resume | |||
include ActiveFormModel | |||
|
|||
attrs = %i[state_event name hexlet_url github_url contact summary skills_description awards_description english_fluency] | |||
attrs = %i[state_event name hexlet_url github_url contact contact_email contact_phone summary skills_description awards_description english_fluency] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contact - тк это будет для телеги, его мб переименуем?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Обсудили с Андреем Г., добавил поле contact_telegram, а старое поле оставил написал что это дополнителные контакты - могут туда всякие ссылки на социалные сети добавить
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b4e33c3
to
d0170a7
Compare
@grozwalker @fey как сможете гляньте если все норм то бахнем |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если валидация пропустит любой тлп, то можно поставить тудушку, что заменить на пакет (как на хекслете или даже лучше!) и мерджить. А доделать уже потом
@@ -19,6 +19,9 @@ class Resume < ApplicationRecord | |||
validates :github_url, presence: true | |||
validates :summary, presence: true, length: { minimum: 200 } | |||
validates :skills_description, presence: true | |||
validates :contact_email, 'valid_email_2/email': true | |||
validates :contact_phone, format: { with: /\A((\d{1}|\+\d{1})[- ]?)?(\(?\d{3}\)?[- ]?)?[\d\- ]{7,10}$\z/ }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а эта валидация пропустить какой-нибудь армянский или казахский номер? + 374 99 629302 например
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вообще это супер рукопашка как по мне и лучше использовать готовые пакеты
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а эта валидация пропустить какой-нибудь армянский или казахский номер? + 374 99 629302 например
да пропустит любой валидный номер формат +7 или 8
contact | ||
contact_email | ||
contact_phone | ||
contact_telegram summary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
И если будешь править перенеси еще summary, а то оно думало скрыться от нас
@usernaimandrey я бы демку посмотрел, как оно используется. |
https://demo-hexlet-cv.onrender.com/ru ща изменения докину |
@fey докинул сейчас за делоится и можно посмотрет |
07c23a9
to
d5a26b1
Compare
No description provided.