Browse Source

lint

CLDC-858-validate-beds
Ted-U 2 years ago
parent
commit
7623ea730e
  1. 6
      app/models/validations/sales_validations.rb

6
app/models/validations/sales_validations.rb

@ -10,10 +10,10 @@ module Validations::SalesValidations
end
def validate_beds_proptype(record)
# Integer(record.offered_before_type_cast)
# Integer(record.offered_before_type_cast)
if record.beds.present? && record.beds.to_i != 1 && record.proptype == 2
record.errors.add :beds, "A bedsit can not have more than 1 bedroom"
record.errors.add :proptype, "A bedsit can not have more than 1 bedroom"
record.errors.add :beds, "A bedsit can not have more than 1 bedroom"
record.errors.add :proptype, "A bedsit can not have more than 1 bedroom"
end
end
end

Loading…
Cancel
Save