From 7c11e4944a726c198126af57fdefa36e52451503 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Wed, 28 Nov 2018 18:11:39 +0500 Subject: [PATCH] Reorder code --- app/views/membership_applications/new.html.erb | 2 +- config/locales/activerecord/en.yml | 2 +- config/locales/activerecord/ru.yml | 2 +- db/migrate/20181126132402_create_membership_applications.rb | 2 +- db/schema.rb | 2 +- factories/membership_applications.rb | 2 +- spec/models/membership_application_spec.rb | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/membership_applications/new.html.erb b/app/views/membership_applications/new.html.erb index 86716a4..fc42a99 100644 --- a/app/views/membership_applications/new.html.erb +++ b/app/views/membership_applications/new.html.erb @@ -6,10 +6,10 @@ <%= f.input :date_of_birth, start_year: Date.today.year - 150, end_year: Date.today.year %> <%= f.input :occupation %> - <%= f.input :comment %> <%= f.input :email %> <%= f.input :phone_number %> <%= f.input :telegram_username %> + <%= f.input :comment %> <%= f.button :submit %> <% end %> diff --git a/config/locales/activerecord/en.yml b/config/locales/activerecord/en.yml index 6cb1131..25117c4 100644 --- a/config/locales/activerecord/en.yml +++ b/config/locales/activerecord/en.yml @@ -11,7 +11,7 @@ en: middle_name: Middle name date_of_birth: Date of birth occupation: Occupation - comment: Comment email: Email phone_number: Phone number telegram_username: Telegram username + comment: Comment diff --git a/config/locales/activerecord/ru.yml b/config/locales/activerecord/ru.yml index 9e8c805..679bc3e 100644 --- a/config/locales/activerecord/ru.yml +++ b/config/locales/activerecord/ru.yml @@ -11,7 +11,7 @@ ru: middle_name: Отчество date_of_birth: Дата рождения occupation: Профессия или род деятельности - comment: Комментарий email: Адрес электронной почты phone_number: Телефонный номер telegram_username: Имя пользователя в Telegram + comment: Комментарий diff --git a/db/migrate/20181126132402_create_membership_applications.rb b/db/migrate/20181126132402_create_membership_applications.rb index ef7940d..65fee7b 100644 --- a/db/migrate/20181126132402_create_membership_applications.rb +++ b/db/migrate/20181126132402_create_membership_applications.rb @@ -10,10 +10,10 @@ class CreateMembershipApplications < ActiveRecord::Migration[5.2] t.string :middle_name t.date :date_of_birth, null: false t.string :occupation - t.text :comment t.string :email, null: false t.string :phone_number, null: false t.string :telegram_username + t.text :comment end end end diff --git a/db/schema.rb b/db/schema.rb index 97d8763..2c71599 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -23,10 +23,10 @@ ActiveRecord::Schema.define(version: 2018_11_26_132402) do t.string "middle_name" t.date "date_of_birth", null: false t.string "occupation" - t.text "comment" t.string "email", null: false t.string "phone_number", null: false t.string "telegram_username" + t.text "comment" end end diff --git a/factories/membership_applications.rb b/factories/membership_applications.rb index 54b9117..171d83a 100644 --- a/factories/membership_applications.rb +++ b/factories/membership_applications.rb @@ -7,9 +7,9 @@ FactoryBot.define do middle_name { Faker::Name.first_name } date_of_birth { Faker::Date.backward } occupation { Faker::Company.profession } - comment { Faker::Lorem.paragraph } email { Faker::Internet.email } phone_number { Faker::PhoneNumber.phone_number } telegram_username { Faker::Internet.username } + comment { Faker::Lorem.paragraph } end end diff --git a/spec/models/membership_application_spec.rb b/spec/models/membership_application_spec.rb index db33818..726426f 100644 --- a/spec/models/membership_application_spec.rb +++ b/spec/models/membership_application_spec.rb @@ -10,8 +10,8 @@ RSpec.describe MembershipApplication, type: :model do it { is_expected.not_to validate_presence_of :middle_name } it { is_expected.to validate_presence_of :date_of_birth } it { is_expected.not_to validate_presence_of :occupation } - it { is_expected.not_to validate_presence_of :comment } it { is_expected.to validate_presence_of :email } it { is_expected.to validate_presence_of :phone_number } it { is_expected.not_to validate_presence_of :telegram_username } + it { is_expected.not_to validate_presence_of :comment } end