diff --git a/app/models/individual.rb b/app/models/individual.rb index 5e3fd2ea6..8ab792ab4 100644 --- a/app/models/individual.rb +++ b/app/models/individual.rb @@ -5,12 +5,4 @@ class Individual < ApplicationRecord validates :gender, presence: true, allow_nil: false, on: :update validates :nom, presence: true, allow_blank: false, allow_nil: false, on: :update validates :prenom, presence: true, allow_blank: false, allow_nil: false, on: :update - - def birthdate - second_birthdate - end - - def birthdate=(date) - self.second_birthdate = date - end end diff --git a/spec/models/individual_spec.rb b/spec/models/individual_spec.rb index 6b11324f1..41c7b5a2f 100644 --- a/spec/models/individual_spec.rb +++ b/spec/models/individual_spec.rb @@ -21,21 +21,18 @@ describe Individual do let(:birthdate_from_user) { "12/11/1980" } it { expect(individual.birthdate).to eq(Date.new(1980, 11, 12)) } - it { expect(individual.second_birthdate).to eq(Date.new(1980, 11, 12)) } end context "and the format is ISO" do let(:birthdate_from_user) { "1980-11-12" } it { expect(individual.birthdate).to eq(Date.new(1980, 11, 12)) } - it { expect(individual.second_birthdate).to eq(Date.new(1980, 11, 12)) } end context "and the format is WTF" do let(:birthdate_from_user) { "1980 1 12" } it { expect(individual.birthdate).to be_nil } - it { expect(individual.second_birthdate).to be_nil } end end end