1 changed files with 7 additions and 1 deletions
@ -1,7 +1,13 @@ |
|||||||
module Validations::SetupValidations |
module Validations::SetupValidations |
||||||
def validate_intermediate_rent_product_name(record) |
def validate_intermediate_rent_product_name(record) |
||||||
if record.rent_type == 5 && record.intermediate_rent_product_name.blank? |
if intermediate_product_rent_type?(record) && record.intermediate_rent_product_name.blank? |
||||||
record.errors.add :intermediate_rent_product_name, I18n.t("validations.setup.intermediate_rent_product_name.blank") |
record.errors.add :intermediate_rent_product_name, I18n.t("validations.setup.intermediate_rent_product_name.blank") |
||||||
end |
end |
||||||
end |
end |
||||||
|
|
||||||
|
private |
||||||
|
|
||||||
|
def intermediate_product_rent_type?(record) |
||||||
|
record.rent_type == 5 |
||||||
|
end |
||||||
end |
end |
||||||
|
Loading…
Reference in new issue