Guest User

Untitled

a guest
May 25th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. class Name < ActiveRecord::Base
  2. belongs_to :person
  3. belongs_to :prefix, :class_name => "LookupCode", :readonly => true
  4. belongs_to :suffix, :class_name => "LookupCode", :readonly => true
  5.  
  6. validate :validate_lookup_codes
  7.  
  8. validates_presence_of :person_id, :message => "must be assigned."
  9. validates_presence_of :last_name, :message => "can't be blank"
  10. validates_length_of :first_name, :middle_name, :last_name, :maximum => 100, :allow_blank => true
  11. validates_length_of :aliases, :maximum => 250, :allow_blank => true
  12. ##
  13.  
  14. class Person < ActiveRecord::Base
  15. has_many :names
  16. has_many :identifiers, :as => :identifiable
  17.  
  18. before_validation :check_external_id
  19.  
  20. validates_length_of :job_title, :employer_name, :maximum => 100, :allow_blank => true
Add Comment
Please, Sign In to add comment