aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-05-28 14:49:40 +0100
committerRobin Houston <robin.houston@gmail.com>2012-06-06 19:34:58 +0100
commitceefc42a75a06f693fe614d345e619ace5014d23 (patch)
tree8a8795adac3c75407d3888fdd7732937715db179 /app/models/info_request.rb
parent141fcea3f05725848f1dbe17ffbda32bd64367a0 (diff)
API: we can add a response to a request
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r--app/models/info_request.rb8
1 files changed, 8 insertions, 0 deletions
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