Method: ATDIS::Models::LandTitleRef#check_title_presence

Defined in:
lib/atdis/models/land_title_ref.rb

#check_title_presenceObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/atdis/models/land_title_ref.rb', line 18

def check_title_presence
  if torrens.nil? && other.nil?
    errors.add(
      :torrens,
      ATDIS::ErrorMessage.new("or other needs be present", "4.3.3")
    )
  end
  return unless torrens && other

  errors.add(
    :torrens,
    ATDIS::ErrorMessage.new("and other can't both be present", "4.3.3")
  )
end