Paste number 43670: Request.dispatched()

Index of paste annotations: 1

Paste number 43670: Request.dispatched()
Pasted by: rsinger
When:2 years, 5 days ago
Share:Tweet this! | http://paste.lisp.org/+XP2
Channel:#code4lib
Paste contents:
Raw Source | XML | Display As
  
  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
  

Annotations for this paste:

Annotation number 1: Problem 2
Pasted by: jrochkind
When:2 years, 5 days ago
Share:Tweet this! | http://paste.lisp.org/+XP2#1
Paste contents:
Raw Source | Display As
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. 

Colorize as:
Show Line Numbers
Index of paste annotations: 1

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.