erp_base_erp_svcs 3.1.5 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +7 -0
  2. data/app/controllers/erp_base_erp_svcs/shared/units_of_measurement_controller.rb +32 -0
  3. data/app/models/compass_ae_instance.rb +2 -0
  4. data/app/models/contact.rb +4 -0
  5. data/app/models/email_address.rb +4 -1
  6. data/app/models/facility.rb +12 -0
  7. data/app/models/facility_type.rb +8 -0
  8. data/app/models/fixed_asset.rb +8 -0
  9. data/app/models/fixed_asset_party_role.rb +8 -0
  10. data/app/models/fixed_asset_type.rb +9 -0
  11. data/app/models/individual.rb +10 -14
  12. data/app/models/party.rb +138 -51
  13. data/app/models/party_unit_of_measurement.rb +6 -0
  14. data/app/models/phone_number.rb +5 -1
  15. data/app/models/postal_address.rb +5 -1
  16. data/app/models/unit_of_measurement.rb +16 -0
  17. data/config/initializers/root_loader.rb +9 -0
  18. data/config/routes.rb +5 -0
  19. data/db/migrate/20080805000020_base_erp_services.rb +1 -29
  20. data/db/migrate/20130522125404_create_facilities.rb +114 -0
  21. data/db/migrate/20130621182047_create_unit_of_measurements.rb +18 -0
  22. data/db/migrate/20130909163912_add_iid_index_to_role_types.rb +9 -0
  23. data/db/migrate/20130926023541_add_domain_to_unit_of_measure.rb +13 -0
  24. data/db/migrate/20130929025342_add_type_semantics_to_uom.rb +54 -0
  25. data/db/migrate/20131112013047_add_primary_to_contacts.rb +13 -0
  26. data/db/migrate/20131112013048_add_erp_base_erp_svcs_missing_indexes.rb +33 -0
  27. data/db/migrate/20131211180831_add_postal_address_to_facility.rb +5 -0
  28. data/db/migrate/20140102154311_create_fixed_asset_party_roles.rb +12 -0
  29. data/db/migrate/20140401072612_add_custom_fields_to_party.rb +12 -0
  30. data/lib/erp_base_erp_svcs.rb +5 -5
  31. data/lib/erp_base_erp_svcs/engine.rb +5 -3
  32. data/lib/erp_base_erp_svcs/extensions.rb +3 -0
  33. data/lib/erp_base_erp_svcs/extensions/active_record/acts_as_facility.rb +54 -0
  34. data/lib/erp_base_erp_svcs/extensions/active_record/acts_as_fixed_asset.rb +54 -0
  35. data/lib/erp_base_erp_svcs/extensions/active_record/has_contact.rb +25 -12
  36. data/lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb +25 -2
  37. data/lib/erp_base_erp_svcs/extensions/active_record/has_tracked_status.rb +58 -6
  38. data/lib/erp_base_erp_svcs/extensions/active_record/to_hash.rb +12 -12
  39. data/lib/erp_base_erp_svcs/extensions/core/acts_as_aspector_on.rb +73 -0
  40. data/lib/erp_base_erp_svcs/extensions/core/object.rb +7 -0
  41. data/lib/erp_base_erp_svcs/version.rb +7 -3
  42. data/lib/tasks/compass_backup.rake +11 -6
  43. data/lib/tasks/erp_base_erp_svcs_tasks.rake +22 -9
  44. data/spec/models/party_spec.rb +9 -1
  45. metadata +80 -113
  46. data/app/assets/javascripts/erp_base_erp_svcs/application.js +0 -9
  47. data/app/assets/stylesheets/erp_base_erp_svcs/application.css +0 -7
  48. data/app/controllers/erp_base_erp_svcs/application_controller.rb +0 -4
  49. data/app/views/layouts/erp_base_erp_svcs/application.html.erb +0 -14
  50. data/spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb +0 -12
  51. data/spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb +0 -19
  52. data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +0 -12
  53. data/spec/dummy/db/data_migrations/20130422154233_upgrade_compass_ae_instances_data.erp_base_erp_svcs.rb +0 -19
  54. data/spec/dummy/db/data_migrations/20130422154234_add_guid_to_instances.erp_base_erp_svcs.rb +0 -10
  55. data/spec/dummy/db/migrate/20130105143821_base_erp_services.erp_base_erp_svcs.rb +0 -461
  56. data/spec/dummy/db/migrate/20130422154229_add_txn_status.erp_base_erp_svcs.rb +0 -37
  57. data/spec/dummy/db/migrate/20130422154230_upgrade_compass_ae_instances.erp_base_erp_svcs.rb +0 -34
  58. data/spec/dummy/db/migrate/20130422154231_add_uuid_compass_ae_instance.erp_base_erp_svcs.rb +0 -17
  59. data/spec/dummy/db/migrate/20130422154232_add_long_lat_to_address.erp_base_erp_svcs.rb +0 -16
  60. data/spec/dummy/db/schema.rb +0 -435
  61. data/spec/dummy/db/spec.sqlite3 +0 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: dd247b66200f776ec62392398963b75b67626880
4
+ data.tar.gz: 176c47d90d2e3a9eb81c55f38b3a8846123eb394
5
+ SHA512:
6
+ metadata.gz: 2472e8d50fda6d0985bda2a6667084c279aeb0c7e107f653741b3b063a69a64f70c3afd3bda3941ed042d964aa9335be6cfd8918bf7d03facad8b5f155bb2f18
7
+ data.tar.gz: a98dfed15080b6c737197eec3eae14fd7620a853a2fe1eb4e360a2fabdfc40d5fa23fd8a6591d0cd5fd177e42f5d0cc64a83c6e17e165f47c2c77a28da46e68b
@@ -0,0 +1,32 @@
1
+ module ErpBaseErpSvcs
2
+ module Shared
3
+ class UnitsOfMeasurementController < ::ErpApp::Organizer::BaseController
4
+
5
+ def index
6
+ offset = params[:start] || 0
7
+ limit = params[:limit] || 25
8
+ query_filter = params[:query_filter].blank? ? nil : params[:query_filter].strip
9
+
10
+ uom_tbl = UnitOfMeasurement.arel_table
11
+ statement = UnitOfMeasurement.order('created_at asc')
12
+
13
+ unless query_filter.blank?
14
+ statement = statement.where(uom_tbl[:description].matches(query_filter + '%'))
15
+ end
16
+
17
+ # Get total count of records
18
+ total = statement.count
19
+
20
+ # Apply limit and offset
21
+ units_of_measurement = statement.offset(offset).limit(limit)
22
+
23
+ render :json => {:success => true, :total => total, :units_of_measurement => units_of_measurement.collect { |uom| uom.to_hash(:only => [:id, :description, :created_at, :updated_at]) }}
24
+
25
+ end
26
+
27
+ #TODO - implement show, update, delete
28
+
29
+ end #UnitsOfMeasurementController
30
+ end #Shared
31
+ end #ErpBaseErpSvcs
32
+
@@ -9,6 +9,7 @@ class CompassAeInstance < ActiveRecord::Base
9
9
  where('role_type_id = ?', RoleType.compass_ae_instance_owner.id)
10
10
  end
11
11
  end
12
+ validates :guid, :uniqueness => true
12
13
  validates :internal_identifier, :presence => {:message => 'internal_identifier cannot be blank'}, :uniqueness => {:case_sensitive => false}
13
14
 
14
15
  def installed_engines
@@ -33,4 +34,5 @@ class CompassAeInstance < ActiveRecord::Base
33
34
  set_guid(guid)
34
35
  guid
35
36
  end
37
+
36
38
  end
@@ -26,6 +26,10 @@ class Contact < ActiveRecord::Base
26
26
  def summary_line
27
27
  "#{contact_mechanism.summary_line}"
28
28
  end
29
+
30
+ def is_primary?
31
+ self.is_primary
32
+ end
29
33
 
30
34
  # return first contact purpose
31
35
  def purpose
@@ -10,8 +10,11 @@ class EmailAddress < ActiveRecord::Base
10
10
  end
11
11
 
12
12
  def to_label
13
- "#{description} : #{email_address}"
13
+ "#{description} : #{to_s}"
14
14
  end
15
15
 
16
+ def to_s
17
+ "#{email_address}"
18
+ end
16
19
 
17
20
  end
@@ -0,0 +1,12 @@
1
+ class Facility < ActiveRecord::Base
2
+ attr_protected :created_at, :updated_at
3
+
4
+ acts_as_fixed_asset
5
+
6
+ #Allow for polymorphic associated subclsses of Facility
7
+ belongs_to :facility_record, :polymorphic => true
8
+ belongs_to :facility_type
9
+
10
+ belongs_to :postal_address
11
+
12
+ end
@@ -0,0 +1,8 @@
1
+ class FacilityType < ActiveRecord::Base
2
+ attr_protected :created_at, :updated_at
3
+
4
+ acts_as_nested_set
5
+ include ErpTechSvcs::Utils::DefaultNestedSetMethods
6
+
7
+ has_many :facilities
8
+ end
@@ -0,0 +1,8 @@
1
+ class FixedAsset < ActiveRecord::Base
2
+ attr_protected :created_at, :updated_at
3
+
4
+ belongs_to :fixed_asset_type
5
+ belongs_to :fixed_asset_record, :polymorphic => true
6
+ has_many :fixed_asset_party_roles
7
+
8
+ end
@@ -0,0 +1,8 @@
1
+ class FixedAssetPartyRole < ActiveRecord::Base
2
+ attr_protected :created_at, :updated_at
3
+
4
+ belongs_to :fixed_asset
5
+ belongs_to :party
6
+ belongs_to :role_type
7
+
8
+ end
@@ -0,0 +1,9 @@
1
+ class FixedAssetType < ActiveRecord::Base
2
+ attr_protected :created_at, :updated_at
3
+
4
+ acts_as_nested_set
5
+ include ErpTechSvcs::Utils::DefaultNestedSetMethods
6
+
7
+ has_many :fixed_assets
8
+
9
+ end
@@ -1,10 +1,10 @@
1
1
  class Individual < ActiveRecord::Base
2
2
  attr_protected :created_at, :updated_at
3
-
3
+
4
4
  require 'attr_encrypted'
5
-
6
- after_create :create_party
7
- after_save :save_party
5
+
6
+ after_create :create_party
7
+ after_save :save_party
8
8
  after_destroy :destroy_party
9
9
 
10
10
  has_one :party, :as => :business_party
@@ -32,13 +32,7 @@ class Individual < ActiveRecord::Base
32
32
  (self.ssn_last_four.blank?) ? "" : "XXX-XX-#{self.ssn_last_four}"
33
33
  end
34
34
 
35
- def self.from_registered_user( a_user )
36
- ind = Individual.new
37
- ind.current_first_name = a_user.first_name
38
- ind.current_last_name = a_user.last_name
39
- end
40
-
41
- def self.from_registered_user( a_user )
35
+ def self.from_registered_user(a_user)
42
36
  ind = Individual.new
43
37
  ind.current_first_name = a_user.first_name
44
38
  ind.current_last_name = a_user.last_name
@@ -55,15 +49,17 @@ class Individual < ActiveRecord::Base
55
49
 
56
50
  def create_party
57
51
  pty = Party.new
58
- pty.description = [current_personal_title,current_first_name,current_last_name].join(' ').strip
52
+ pty.description = [current_personal_title, current_first_name, current_last_name].join(' ').strip
59
53
  pty.business_party = self
60
54
  pty.save
61
55
  self.save
62
56
  end
63
57
 
64
58
  def save_party
65
- self.party.description = [current_personal_title,current_first_name,current_last_name].join(' ').strip
66
- self.party.save
59
+ if self.party.description.blank? && (!current_first_name.blank? && !current_last_name.blank?)
60
+ self.party.description = [current_personal_title, current_first_name, current_last_name].join(' ').strip
61
+ self.party.save
62
+ end
67
63
  end
68
64
 
69
65
  def destroy_party
@@ -2,49 +2,69 @@ class Party < ActiveRecord::Base
2
2
  attr_protected :created_at, :updated_at
3
3
 
4
4
  has_notes
5
-
6
- has_many :contacts, :dependent => :destroy
7
- has_many :created_notes, :class_name => 'Note', :foreign_key => 'created_by_id'
5
+
6
+ has_many :contacts, :dependent => :destroy
7
+ has_many :created_notes, :class_name => 'Note', :foreign_key => 'created_by_id'
8
8
  belongs_to :business_party, :polymorphic => true
9
9
 
10
- has_many :party_roles, :dependent => :destroy #role_types
11
- has_many :role_types, :through => :party_roles
10
+ has_many :party_roles, :dependent => :destroy #role_types
11
+ has_many :role_types, :through => :party_roles
12
12
 
13
- after_destroy :destroy_business_party
13
+ after_destroy :destroy_business_party, :destroy_party_relationships
14
14
 
15
- attr_reader :relationships
15
+ attr_reader :relationships
16
16
  attr_writer :create_relationship
17
17
 
18
+ # serialize ExtJs attributes
19
+ is_json :custom_fields
20
+
18
21
  # Gathers all party relationships that contain this particular party id
19
22
  # in either the from or to side of the relationship.
20
23
  def relationships
21
24
  @relationships ||= PartyRelationship.where('party_id_from = ? or party_id_to = ?', id, id)
22
25
  end
23
26
 
27
+ def to_relationships
28
+ @relationships ||= PartyRelationship.where('party_id_to = ?', id)
29
+ end
30
+
31
+ def from_relationships
32
+ @relationships ||= PartyRelationship.where('party_id_from = ?', id)
33
+ end
34
+
24
35
  def find_relationships_by_type(relationship_type_iid)
25
36
  PartyRelationship.includes(:relationship_type).
26
- where('party_id_from = ? or party_id_to = ?', id, id).
27
- where('relationship_types.internal_identifier' => relationship_type_iid.to_s)
37
+ where('party_id_from = ? or party_id_to = ?', id, id).
38
+ where('relationship_types.internal_identifier' => relationship_type_iid.to_s)
28
39
  end
29
40
 
30
41
  # Creates a new PartyRelationship for this particular
31
42
  # party instance.
32
- def create_relationship(description, to_party_id)
33
- PartyRelationship.create(:description => description, :party_id_from => id, :party_id_to => to_party_id)
43
+ def create_relationship(description, to_party_id, reln_type)
44
+ PartyRelationship.create(:description => description,
45
+ :relationship_type => reln_type,
46
+ :party_id_from => id,
47
+ :from_role => reln_type.valid_from_role,
48
+ :party_id_to => to_party_id,
49
+ :to_role => reln_type.valid_to_role)
34
50
  end
35
51
 
36
- # Callback
37
- def destroy_business_party
52
+ # Callbacks
53
+ def destroy_business_party
38
54
  if self.business_party
39
55
  self.business_party.destroy
40
56
  end
41
- end
57
+ end
58
+
59
+ def destroy_party_relationships
60
+ PartyRelationship.destroy_all("party_id_from = #{id} or party_id_to = #{id}")
61
+ end
42
62
 
43
63
  def has_role_type?(*passed_roles)
44
64
  result = false
45
65
  passed_roles.flatten!
46
66
  passed_roles.each do |role|
47
- role_iid = role.is_a?(RoleType) ? role.internal_identifier : role.to_s
67
+ role_iid = role.is_a?(RoleType) ? role.internal_identifier : role.to_s
48
68
  self.role_types.each do |this_role|
49
69
  result = true if (this_role.internal_identifier == role_iid)
50
70
  break if result
@@ -81,37 +101,101 @@ class Party < ActiveRecord::Base
81
101
  # Alias for to_s
82
102
  def to_label
83
103
  to_s
84
- end
104
+ end
85
105
 
86
- def to_s
106
+ def to_s
87
107
  "#{description}"
88
- end
89
-
108
+ end
90
109
 
91
110
  #************************************************************************************************
92
111
  #** Contact Methods
93
112
  #************************************************************************************************
94
113
 
95
- def find_contact_mechanism_with_purpose(contact_mechanism_class, contact_purpose)
114
+ def primary_phone_number
96
115
  contact_mechanism = nil
97
116
 
98
- contact = self.find_contact_with_purpose(contact_mechanism_class, contact_purpose)
117
+ contact = self.get_primary_contact(PhoneNumber)
99
118
  contact_mechanism = contact.contact_mechanism unless contact.nil?
100
119
 
101
120
  contact_mechanism
102
121
  end
103
122
 
104
- def find_contact_with_purpose(contact_mechanism_class, contact_purpose)
105
- contact = nil
123
+ alias primary_phone primary_phone_number
124
+
125
+ def primary_phone_number=(phone_number)
126
+ self.set_primary_contact(PhoneNumber, phone_number)
127
+ end
128
+
129
+ alias primary_phone= primary_phone_number=
130
+
131
+ def primary_email_address
132
+ contact_mechanism = nil
133
+
134
+ contact = self.get_primary_contact(EmailAddress)
135
+ contact_mechanism = contact.contact_mechanism unless contact.nil?
136
+
137
+ contact_mechanism
138
+ end
139
+
140
+ alias primary_email primary_email_address
141
+
142
+ def primary_email_address=(email_address)
143
+ self.set_primary_contact(EmailAddress, email_address)
144
+ end
145
+
146
+ alias primary_email= primary_email_address=
106
147
 
148
+ def primary_postal_address
149
+ contact_mechanism = nil
150
+
151
+ contact = self.get_primary_contact(PostalAddress)
152
+ contact_mechanism = contact.contact_mechanism unless contact.nil?
153
+
154
+ contact_mechanism
155
+ end
156
+
157
+ alias primary_address primary_postal_address
158
+
159
+ def primary_postal_address=(postal_address)
160
+ self.set_primary_contact(PostalAddress, postal_address)
161
+ end
162
+
163
+ alias primary_address= primary_postal_address=
164
+
165
+ def set_primary_contact(contact_mechanism_class, contact_mechanism_instance)
166
+ # set is_primary to false for any current primary contacts of this type
167
+ primary_contact_mechanism = get_primary_contact(contact_mechanism_class)
168
+ if primary_contact_mechanism
169
+ primary_contact_mechanism.is_primary = false
170
+ primary_contact_mechanism.save
171
+ end
172
+
173
+ contact_mechanism_instance.is_primary = true
174
+ contact_mechanism_instance.save
175
+
176
+ contact_mechanism_instance
177
+ end
178
+
179
+ def get_primary_contact(contact_mechanism_class)
180
+ table_name = contact_mechanism_class.name.tableize
181
+
182
+ self.contacts.joins("inner join #{table_name} on #{table_name}.id = contact_mechanism_id and contact_mechanism_type = '#{contact_mechanism_class.name}'")
183
+ .where('contacts.is_primary = ?', true).readonly(false).first
184
+ end
185
+
186
+ def find_contact_mechanism_with_purpose(contact_mechanism_class, contact_purpose)
187
+ contact = self.find_contact_with_purpose(contact_mechanism_class, contact_purpose)
188
+
189
+ contact.contact_mechanism unless contact.nil?
190
+ end
191
+
192
+ def find_contact_with_purpose(contact_mechanism_class, contact_purpose)
107
193
  #if a symbol or string was passed get the model
108
194
  unless contact_purpose.is_a? ContactPurpose
109
195
  contact_purpose = ContactPurpose.find_by_internal_identifier(contact_purpose.to_s)
110
196
  end
111
197
 
112
- contact = self.find_contact(contact_mechanism_class, nil, [contact_purpose])
113
-
114
- contact
198
+ self.find_contact(contact_mechanism_class, nil, [contact_purpose])
115
199
  end
116
200
 
117
201
  def find_all_contacts_by_contact_mechanism(contact_mechanism_class)
@@ -124,13 +208,13 @@ class Party < ActiveRecord::Base
124
208
 
125
209
  def find_contact(contact_mechanism_class, contact_mechanism_args={}, contact_purposes=[])
126
210
  table_name = contact_mechanism_class.name.tableize
127
-
211
+
128
212
  query = self.contacts.joins("inner join #{table_name} on #{table_name}.id = contact_mechanism_id and contact_mechanism_type = '#{contact_mechanism_class.name}'
129
213
  inner join contact_purposes_contacts on contact_purposes_contacts.contact_id = contacts.id
130
- and contact_purposes_contacts.contact_purpose_id in (#{contact_purposes.collect{|item| item.attributes["id"]}.join(',')})")
131
-
214
+ and contact_purposes_contacts.contact_purpose_id in (#{contact_purposes.collect { |item| item.attributes["id"] }.join(',')})")
215
+
132
216
  contact_mechanism_args.each do |key, value|
133
- next if key == 'updated_at' or key == 'created_at' or key == 'id'
217
+ next if key == 'updated_at' or key == 'created_at' or key == 'id' or key == 'is_primary'
134
218
  query = query.where("#{table_name}.#{key} = ?", value) unless value.nil?
135
219
  end unless contact_mechanism_args.nil?
136
220
 
@@ -140,34 +224,33 @@ class Party < ActiveRecord::Base
140
224
  # looks for contacts matching on value and purpose
141
225
  # if a contact exists, it updates, if not, it adds it
142
226
  def add_contact(contact_mechanism_class, contact_mechanism_args={}, contact_purposes=[])
227
+ is_primary = contact_mechanism_args['is_primary']
143
228
  contact_purposes = [contact_purposes] if !contact_purposes.kind_of?(Array) # gracefully handle a single purpose not in an array
144
- contact = find_contact(contact_mechanism_class, contact_mechanism_args, contact_purposes)
145
- if contact.nil?
146
- contact_mechanism_args.delete_if{|k,v| ['created_at','updated_at'].include? k.to_s}
147
- contact_mechanism = contact_mechanism_class.new(contact_mechanism_args)
148
- contact_mechanism.contact.party = self
149
- contact_mechanism.contact.contact_purposes = contact_purposes
150
- contact_mechanism.contact.save
151
- contact_mechanism.save
152
-
153
- self.contacts << contact_mechanism.contact
154
- else
155
- contact_mechanism = update_contact(contact_mechanism_class, contact, contact_mechanism_args)
156
- end
157
-
229
+
230
+ contact_mechanism_args.delete_if { |k, v| ['created_at', 'updated_at', 'is_primary'].include? k.to_s }
231
+ contact_mechanism = contact_mechanism_class.new(contact_mechanism_args)
232
+ contact_mechanism.contact.party = self
233
+ contact_mechanism.contact.contact_purposes = contact_purposes
234
+ contact_mechanism.contact.save
235
+ contact_mechanism.save
236
+
237
+ set_primary_contact(contact_mechanism_class, contact_mechanism) if is_primary
238
+
158
239
  contact_mechanism
159
240
  end
160
241
 
161
242
  # tries to update contact by purpose
162
243
  # if contact doesn't exist, it adds it
163
244
  def update_or_add_contact_with_purpose(contact_mechanism_class, contact_purpose, contact_mechanism_args)
164
- if return_value = update_contact_with_purpose(contact_mechanism_class, contact_purpose, contact_mechanism_args)
165
- return_value
166
- else
167
- add_contact(contact_mechanism_class, contact_mechanism_args, [contact_purpose])
245
+ contact_mechanism = update_contact_with_purpose(contact_mechanism_class, contact_purpose, contact_mechanism_args)
246
+
247
+ unless contact_mechanism
248
+ contact_mechanism = add_contact(contact_mechanism_class, contact_mechanism_args, [contact_purpose])
168
249
  end
250
+
251
+ contact_mechanism
169
252
  end
170
-
253
+
171
254
  # looks for a contact matching on purpose
172
255
  # if it exists, it updates it, if not returns false
173
256
  def update_contact_with_purpose(contact_mechanism_class, contact_purpose, contact_mechanism_args)
@@ -176,7 +259,11 @@ class Party < ActiveRecord::Base
176
259
  end
177
260
 
178
261
  def update_contact(contact_mechanism_class, contact, contact_mechanism_args)
262
+ set_primary_contact(contact_mechanism_class, contact.contact_mechanism) if contact_mechanism_args[:is_primary] == true
263
+
179
264
  contact_mechanism_class.update(contact.contact_mechanism, contact_mechanism_args)
265
+
266
+ contact.contact_mechanism
180
267
  end
181
268
 
182
269
  def get_contact_by_method(m)
@@ -210,7 +297,7 @@ class Party < ActiveRecord::Base
210
297
  def respond_to?(m, include_private_methods = false)
211
298
  (super ? true : get_contact_by_method(m.to_s)) rescue super
212
299
  end
213
-
300
+
214
301
  def method_missing(m, *args, &block)
215
302
  if self.respond_to?(m)
216
303
  value = get_contact_by_method(m.to_s)
@@ -219,7 +306,7 @@ class Party < ActiveRecord::Base
219
306
  super
220
307
  end
221
308
  end
222
-
309
+
223
310
  #************************************************************************************************
224
311
  #** End
225
312
  #************************************************************************************************