10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/erp_base_erp_svcs/extensions/active_record/is_contact_mechanism.rb', line 10
def is_contact_mechanism
extend IsContactMechanism::SingletonMethods
include IsContactMechanism::InstanceMethods
after_initialize :initialize_contact
after_create :save_contact
after_update :save_contact
after_destroy :destroy_contact
has_one :contact, :as => :contact_mechanism, :dependent => :destroy
[:purpose,
:purposes,
:is_primary,
:is_primary=,
:is_primary?].each { |m| delegate m, :to => :contact }
end
|