Class: ATDIS::Models::LandTitleRef

Inherits:
ATDIS::Model show all
Defined in:
lib/atdis/models/land_title_ref.rb

Instance Attribute Summary

Attributes inherited from ATDIS::Model

#attributes, #attributes_before_type_cast, #json_left_overs, #json_load_error, #url

Instance Method Summary collapse

Methods inherited from ATDIS::Model

attribute_keys, attribute_names, cast, #initialize, interpret, #json_errors, #json_errors_in_children, #json_errors_local, #json_left_overs_is_empty, #json_loaded_correctly!, partition_by_used, read_json, read_url, #used_attribute?

Constructor Details

This class inherits a constructor from ATDIS::Model

Instance Method Details

#check_title_presenceObject



16
17
18
19
20
21
22
23
# File 'lib/atdis/models/land_title_ref.rb', line 16

def check_title_presence
  if torrens.nil? && other.nil?
    errors.add(:torrens, ATDIS::ErrorMessage.new("or other needs be present", "4.3.3"))
  end
  if torrens && other
    errors.add(:torrens, ATDIS::ErrorMessage.new("and other can't both be present", "4.3.3"))
  end
end