Skip to content

Instantly share code, notes, and snippets.

@beck03076
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save beck03076/5cac316cbada6d987f63 to your computer and use it in GitHub Desktop.

Select an option

Save beck03076/5cac316cbada6d987f63 to your computer and use it in GitHub Desktop.
def set_response_time
unless auto
enquiries.each do |enquiry|
if enquiry.response_time.nil?
response_hours = ((self.created_at - e.assigned_at) / 3600).round(2)
enquiry.update_attribute(:response_time,response_hours)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment