diff --git a/app/operations/medical_shift_recurrences/create.rb b/app/operations/medical_shift_recurrences/create.rb index d9c0749..6ac0a39 100644 --- a/app/operations/medical_shift_recurrences/create.rb +++ b/app/operations/medical_shift_recurrences/create.rb @@ -60,7 +60,8 @@ def shift_attributes(date) hospital_name: medical_shift_recurrence.hospital_name, amount_cents: medical_shift_recurrence.amount_cents, medical_shift_recurrence_id: medical_shift_recurrence.id, - paid: false + paid: false, + color: medical_shift_recurrence.color } end diff --git a/config/locales/en/activerecord.yml b/config/locales/en/activerecord.yml new file mode 100644 index 0000000..f287b97 --- /dev/null +++ b/config/locales/en/activerecord.yml @@ -0,0 +1,34 @@ +en: + activerecord: + models: + medical_shift_recurrence: "Medical Shift Recurrence" + medical_shift: "Medical Shift" + attributes: + medical_shift_recurrence: + day_of_week: "Day of week" + frequency: "Frequency" + start_date: "Start date" + workload: "Workload" + start_hour: "Start hour" + hospital_name: "Hospital name" + amount_cents: "Amount" + color: "Color" + day_of_month: "Day of month" + end_date: "End date" + errors: + models: + medical_shift_recurrence: + attributes: + day_of_week: + blank: "can't be blank" + not_a_number: "is not a number" + greater_than_or_equal_to: "must be greater than or equal to %{count}" + less_than_or_equal_to: "must be less than or equal to %{count}" + medical_shift: + color: "Color" + hospital_name: "Hospital name" + workload: "Workload" + start_date: "Start date" + start_hour: "Start hour" + amount_cents: "Amount" + paid: "Paid" diff --git a/spec/operations/medical_shift_recurrences/create_spec.rb b/spec/operations/medical_shift_recurrences/create_spec.rb index cc9f0cb..5970b6e 100644 --- a/spec/operations/medical_shift_recurrences/create_spec.rb +++ b/spec/operations/medical_shift_recurrences/create_spec.rb @@ -65,6 +65,7 @@ expect(shift.hospital_name).to eq("Hospital Teste") expect(shift.amount_cents).to eq(120_000) expect(shift.paid).to be false + expect(shift.color).to eq("#ffffff") end end end