Skip to content
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

Merged
merged 1 commit into from Mar 31, 2023

Conversation

usernaimandrey
Copy link
Contributor

No description provided.

@fey
Copy link
Collaborator

fey commented Mar 30, 2023

@usernaimandrey deploy demo, please.

@@ -0,0 +1,5 @@
class AddContactPhoneToResumes < ActiveRecord::Migration[7.0]
def change
add_column :resumes, :contact_phone, :string
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Может надо добавить еще и валидацию телефона?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да добавил

@@ -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]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contact - тк это будет для телеги, его мб переименуем?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Обсудили с Андреем Г., добавил поле contact_telegram, а старое поле оставил написал что это дополнителные контакты - могут туда всякие ссылки на социалные сети добавить

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@usernaimandrey
Copy link
Contributor Author

@grozwalker @fey как сможете гляньте если все норм то бахнем

Copy link
Contributor

@grozwalker grozwalker left a 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/ },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а эта валидация пропустить какой-нибудь армянский или казахский номер? + 374 99 629302 например

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вообще это супер рукопашка как по мне и лучше использовать готовые пакеты

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И если будешь править перенеси еще summary, а то оно думало скрыться от нас

@fey
Copy link
Collaborator

fey commented Mar 31, 2023

@usernaimandrey я бы демку посмотрел, как оно используется.

@usernaimandrey
Copy link
Contributor Author

usernaimandrey commented Mar 31, 2023

@usernaimandrey я бы демку посмотрел, как оно используется.

https://demo-hexlet-cv.onrender.com/ru

ща изменения докину

@usernaimandrey
Copy link
Contributor Author

@usernaimandrey я бы демку посмотрел, как оно используется.

@fey докинул сейчас за делоится и можно посмотрет

@usernaimandrey usernaimandrey merged commit a11a833 into Hexlet:main Mar 31, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants