Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
module Validations::Sales::PropertyInformationValidations
|
|
|
|
# Error must be defined for both :proptype and :beds
|
|
|
|
# to ensure the appropriate error is shown when selecting
|
|
|
|
# property type and number of rooms
|
|
|
|
def validate_bedsit_has_one_room(record)
|
|
|
|
if record.bedsit? && record.beds > 1
|
|
|
|
record.errors.add(:proptype, :bedsit_max)
|
|
|
|
record.errors.add(:beds, :bedsit_max)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|