def dispatched(service, success)
ds = self.dispatched_services.find(:first, :conditions=>["service_name = ?", service.id])
unless ds
ds = self.dispatched_services.create()
end
ds.service = service
ds.successful = success
ds.save
end
def add_service_response(response_data,service_type=[])
unless response_data.empty?
svc_resp = nil
ServiceResponse.find(:all, :conditions=>["service_id = ? and key = ? and value_string = ? and value_alt_string = ?", response_data[:service].id, response_data[:key], response_data[:value_string], response_data[:value_alt_string]]).each do | resp |
svc_resp = resp if resp.value_text = response_data[:value_text]
end
[...]
service_id no longer exists in the db.