Class: NamePerson
- Inherits:
-
Sequel::Model
- Object
- Sequel::Model
- NamePerson
- Includes:
- ASModel, AgentNames, AutoGenerator
- Defined in:
- backend/app/model/name_person.rb
Class Method Summary (collapse)
Instance Method Summary (collapse)
Methods included from AutoGenerator
Methods included from AgentNames
#before_validation, included, #update_from_json
Methods included from ASModel
all_models, included, update_publish_flag, update_suppressed_flag
Methods included from JSONModel
JSONModel, #JSONModel, add_error_handler, all, allow_unmapped_enum_value, backend_url, client_mode?, custom_validations, destroy_model, enum_default_value, enum_values, handle_error, init, load_schema, #models, models, parse_jsonmodel_ref, parse_reference, repository, repository_for, schema_src, set_repository, strict_mode, strict_mode?, with_repository
Class Method Details
+ (Object) type_specific_hash_fields
25 26 27 |
# File 'backend/app/model/name_person.rb', line 25 def self.type_specific_hash_fields %w(primary_name title name_order prefix rest_of_name suffix fuller_form number qualifier ) end |
Instance Method Details
- (Object) validate
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'backend/app/model/name_person.rb', line 8 def validate if validates_unique([:authorized, :agent_person_id], :message => "An agent can only have one authorized name") map_validation_to_json_property([:authorized, :agent_person_id], :authorized) end if is_display_name validates_unique([:is_display_name, :agent_person_id], :message => "An agent can only have one display name") map_validation_to_json_property([:is_display_name, :agent_person_id], :is_display_name) end super end |