Sha256: 14b5e545874519159646fb311dd206d199b5ccbc9856d47e6fa3746b207ef3ae

Contents?: true

Size: 518 Bytes

Versions: 4

Compression:

Stored size: 518 Bytes

Contents

module CustomerVault
  class Person < ActiveRecord::Base
    self.abstract_class = true
    
    def self.list 
      individuals = Individual.all
      corporations = Corporation.all
      return (individuals + corporations)
    end

    def links
      a = Link.where(alice_id: self.id, alice_type: self.class).map {|l| {title: l.title, person: l.bob, origin: l}}
      b = Link.where(bob_id: self.id, bob_type: self.class).map {|l| {title: l.title, person: l.alice, origin: l}}
      return a + b
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
customer_vault-1.0.4 app/models/customer_vault/person.rb
customer_vault-1.0.3 app/models/customer_vault/person.rb
customer_vault-1.0.2 app/models/customer_vault/person.rb
customer_vault-1.0.1 app/models/customer_vault/person.rb