Commit 25a94af0 authored by Tugce Nur Tas's avatar Tugce Nur Tas Committed by Tuğçe Nur Taş
Browse files

rename date of birth to birth year

parent ffc7e06d
......@@ -57,7 +57,7 @@ class ClientsController < ApplicationController
def client_params
params.require(:client).permit(
:entry_year, :gender_request, :age_request, :other_request, :date_of_birth,
:entry_year, :gender_request, :age_request, :other_request, :birth_year,
:gender, :nationality, :permit, :goals, :education, :interests,
:state, :comments, :involved_authority, :competent_authority, :actual_activities,
language_skills_attributes, relatives_attributes, schedules_attributes,
......
......@@ -10,7 +10,7 @@ module NestedAttributes
def relatives_attributes
{
relatives_attributes: [:id, :first_name, :last_name, :date_of_birth, :relation, :_destroy]
relatives_attributes: [:id, :first_name, :last_name, :birth_year, :relation, :_destroy]
}
end
......
......@@ -4,7 +4,7 @@ module VolunteerAttributes
included do
def volunteer_attributes
[
:date_of_birth, :gender, :avatar, :nationality, :additional_nationality,
:birth_year, :gender, :avatar, :nationality, :additional_nationality,
:profession, :education, :motivation, :experience, :expectations,
:strengths, :skills, :interests, :state, :duration, :man, :woman,
:family, :kid, :sport, :creative, :music, :culture, :training,
......
......@@ -5,7 +5,7 @@ class Relative < ApplicationRecord
def to_s
relation_human = relation ? I18n.t(relation, scope: [:relation]) : ''
[full_name, date_of_birth.try(:year), relation_human].reject(&:blank?).join(', ')
[full_name, birth_year.try(:year), relation_human].reject(&:blank?).join(', ')
end
def full_name
......
......@@ -48,9 +48,9 @@
= @assignment.volunteer.contact.contact_phones.first.body unless @assignment.volunteer.contact.contact_phones.first.nil?
.row
.col-xs-5
= t('assignment_pdf.date_of_birth')
= t('assignment_pdf.birth_year')
.col-xs-7.col-input
= @assignment.volunteer.date_of_birth
= @assignment.volunteer.birth_year
.row
.col-xs-11.col-xs-offset-1
......@@ -82,9 +82,9 @@
= @assignment.client.contact.primary_email
.row
.col-xs-5
= t('assignment_pdf.date_of_birth')
= t('assignment_pdf.birth_year')
.col-xs-7.col-input
= @assignment.client.date_of_birth
= @assignment.client.birth_year
.col-xs-6
.row
.col-xs-5
......
......@@ -2,7 +2,7 @@ tr
td = t("gender.#{client.gender}") unless client.gender.blank?
td = client.contact.full_name
td = client.contact.full_address
td = client.date_of_birth.year if client.date_of_birth
td = client.birth_year.year if client.birth_year
td
- client.relatives.each do |relative|
= relative.to_s
......
......@@ -6,7 +6,7 @@
th= t_attr(:gender, Client)
th= t_attr(:full_name, Client)
th= t_attr(:address, Client)
th= t_attr(:date_of_year, Client)
th= t_attr(:birth_year, Client)
th= t_attr(:relatives, Client)
th= t_attr(:nationality, Client)
- if action_name == 'find_client'
......
......@@ -7,7 +7,7 @@
.row
.col-xs-12.col-md-6
= f.input :date_of_birth,
= f.input :birth_year,
as: :select,
collection: Client.year_collection,
include_blank: true
......
......@@ -10,8 +10,8 @@
tbody
= render 'contacts/show', contact: @client.contact
tr
td= t_attr(:date_of_birth)
td= @client.date_of_birth.try(:year)
td= t_attr(:birth_year)
td= @client.birth_year.try(:year)
tr
td= t_attr(:gender)
td
......
......@@ -8,7 +8,7 @@
.row
.col-xs-12.col-md-6
= f.input :date_of_birth,
= f.input :birth_year,
as: :select,
collection: Relative.year_collection,
include_blank: true
......@@ -19,4 +19,4 @@
.row
.col-xs-12.col-md-12
= link_to_remove_association t('remove_relative'), f, class: 'btn btn-danger'
\ No newline at end of file
= link_to_remove_association t('remove_relative'), f, class: 'btn btn-danger'
......@@ -7,7 +7,7 @@ tr
dt= relative.full_name
- if relative.full_name.present?
dd
= relative.date_of_birth.try(:year)
= relative.birth_year.try(:year)
- if relative.relation.present?
|,
= t("relation.#{relative.relation}")
......@@ -40,8 +40,8 @@ p= @volunteer.contact.primary_email
= ": "
= phone.body
h4= "#{t_attr(:date_of_birth, Volunteer)}: "
p= l(@volunteer.date_of_birth) if @volunteer.date_of_birth
h4= "#{t_attr(:birth_year, Volunteer)}: "
p= l(@volunteer.birth_year) if @volunteer.birth_year
h4= "#{t_attr(:gender, Volunteer)}: "
......
......@@ -37,8 +37,8 @@
= " / #{phone.label}" if phone.label.present?
= ": #{phone.body}\r\n"
- if @volunteer.date_of_birth.present?
= "#{rn2}#{t_attr(:date_of_birth, Volunteer)}:#{t3}#{l(@volunteer.date_of_birth)}\r\n"
- if @volunteer.birth_year.present?
= "#{rn2}#{t_attr(:birth_year, Volunteer)}:#{t3}#{l(@volunteer.birth_year)}\r\n"
- if @volunteer.gender.present?
= "\r\n#{t_attr(:gender, Volunteer)}:#{t3}"
......
......@@ -8,7 +8,7 @@
th= sort_link @q, :contact_city
th= sort_link @q, :contact_postal_code
th= sort_link @q, :contact_contact_emails_body
th= sort_link @q, :date_of_birth, t_attr(:birth_year, Volunteer)
th= sort_link @q, :birth_year, t_attr(:birth_year, Volunteer)
th= sort_link @q, :language_skills_language, t_attr(:first_language, Volunteer)
th= t_attr(:languages, Volunteer)
th= sort_link @q, :education
......
......@@ -5,7 +5,7 @@ tr
td = volunteer.contact.city
td = volunteer.contact.postal_code
td = volunteer.contact.contact_emails.first.body if volunteer.contact.contact_emails.any?
td = volunteer.date_of_birth.year if volunteer.date_of_birth.present?
td = volunteer.birth_year.year if volunteer.birth_year.present?
td = volunteer.language_skills.first.language_name if volunteer.language_skills.any?
td = render 'language_skills/show_inline', language_skills: volunteer.language_skills
td = volunteer.education
......
......@@ -15,8 +15,8 @@
tbody
= render 'contacts/show', contact: @volunteer.contact
tr
td= t_attr(:date_of_birth)
td= l(@volunteer.date_of_birth) if @volunteer.date_of_birth
td= t_attr(:birth_year)
td= l(@volunteer.birth_year) if @volunteer.birth_year
tr
td= t_attr(:gender)
td= t("gender.#{@volunteer.gender}") if @volunteer.gender.present?
......
......@@ -16,7 +16,7 @@ de:
comments: Bemerkungen
competent_authority: Zusätzlich involvierte Stelle
created_at: Erstellt am
date_of_birth: Geburtsdatum
birth_year: Jahrgang
date_of_year: Geburtsjahr
deleted_at: Gelöscht
education: Beruf oder Ausbildung im Herkunftsland
......@@ -83,7 +83,7 @@ de:
tuesday: Dienstag
wednesday: Mittwoch
relative:
date_of_birth: Geburtsdatum
birth_year: Jahrgang
first_name: Vorname
last_name: Nachname
relation: Verwandtschaftsbeziehung
......@@ -110,7 +110,6 @@ de:
created_at: Erstellt am
creative: Kreativ
culture: Kultur
date_of_birth: Geburtsdatum
duration: Dauer der Begleitung
education: Ausbildung
email: Email
......
class ChangeDateOfBirth < ActiveRecord::Migration[5.1]
def change
rename_column :clients, :date_of_birth, :birth_year
rename_column :relatives, :date_of_birth, :birth_year
rename_column :volunteers, :date_of_birth, :birth_year
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170713134956) do
ActiveRecord::Schema.define(version: 20170719134921) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -29,7 +29,7 @@ ActiveRecord::Schema.define(version: 20170713134956) do
end
create_table "clients", force: :cascade do |t|
t.date "date_of_birth"
t.date "birth_year"
t.string "nationality"
t.string "permit"
t.string "gender"
......@@ -146,7 +146,7 @@ ActiveRecord::Schema.define(version: 20170713134956) do
t.bigint "relativeable_id"
t.string "first_name"
t.string "last_name"
t.date "date_of_birth"
t.date "birth_year"
t.string "relation"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
......@@ -220,7 +220,7 @@ ActiveRecord::Schema.define(version: 20170713134956) do
end
create_table "volunteers", force: :cascade do |t|
t.date "date_of_birth"
t.date "birth_year"
t.string "gender"
t.string "nationality"
t.string "additional_nationality"
......
......@@ -22,7 +22,7 @@ def make_relatives
relative.first_name = Faker::Name.first_name
relative.last_name = Faker::Name.last_name
relative.relation = random_relation
relative.date_of_birth = Faker::Date.birthday(18, 65)
relative.birth_year = Faker::Date.birthday(18, 65)
end
end
end
......@@ -87,7 +87,7 @@ User.where(role: ['superadmin', 'social_worker']).each do |user|
user: user
)
]
client.date_of_birth = Faker::Date.birthday(18, 65)
client.birth_year = Faker::Date.birthday(18, 65)
client.gender = ['male', 'female'].sample
client.nationality = ISO3166::Country.codes.sample
client.relatives = make_relatives
......@@ -157,7 +157,7 @@ Volunteer.state_collection.each do |state|
user: User.first
)
]
volunteer.date_of_birth = Faker::Date.birthday(18, 75)
volunteer.birth_year = Faker::Date.birthday(18, 75)
volunteer.profession = Faker::Company.profession
volunteer.gender = ['male', 'female'].sample
volunteer.working_percent = "#{rand(2..10)}0"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment