From ceefc42a75a06f693fe614d345e619ace5014d23 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Mon, 28 May 2012 14:49:40 +0100 Subject: API: we can add a response to a request --- app/models/info_request.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 2f1270a95..8d9d92b0d 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -120,6 +120,14 @@ class InfoRequest < ActiveRecord::Base errors.add(:external_url, "must be null for an internal request") if !external_url.nil? end end + + def is_external? + !external_url.nil? + end + + def user_name + is_external? ? external_user_name : user.name + end @@custom_states_loaded = false begin -- cgit v1.2.3