Sha256: 0884d13b3710a89a95dd95e464da7b6c6763cdb74df225febeb05af35e52468a

Contents?: true

Size: 854 Bytes

Versions: 5

Compression:

Stored size: 854 Bytes

Contents

module Concernz
  module Party
    extend ActiveSupport::Concern
    included do
      self.primary_key = 'party_id'

      # maybe Party is a Person and Person is involved in Birth and maybe Birth was assisted by attending-Doctor and Doctor is a kind of Person and Person is a kind of Party
      belongs_to :party_via_person_birth_doctor_person, :class_name => 'Party', :foreign_key => :person_attending_doctor_id

      # Party is a Person and Person is a Doctor and maybe Doctor attended Birth and Birth involves Person and maybe Person is a kind of Party
      has_many :parties_via_person_birth_doctor_person, :class_name => 'Party', :foreign_key => :person_attending_doctor_id, :dependent => :destroy

      validates :party_moniker_accuracy_level, :presence => true
      validates :party_moniker_party_name, :presence => true
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
activefacts-examples-1.9.9 rails/models/OneRoleNesting.models
activefacts-examples-1.9.8 rails/models/OneRoleNesting.models
activefacts-examples-1.8.0 rails/models/OneRoleNesting.models
activefacts-examples-1.7.2 rails/models/OneRoleNesting.models
activefacts-examples-1.7.1 rails/models/OneRoleNesting.models