diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-06-06 15:37:15 +0100 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-06-06 19:35:13 +0100 |
commit | ba0811b35d41a18a01977ba53147da522541b151 (patch) | |
tree | 6d1e1b9abccad4b19420d1054d1d2409680904db /app/models/info_request.rb | |
parent | c89e6efac2fb10ddf3c1a111f188c64743c3714e (diff) |
Fix indexing of info_request_events
Even external requests need to be indexed, for which we need a
slug representing the user.
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 8d9d92b0d..99cbe476a 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -128,6 +128,19 @@ class InfoRequest < ActiveRecord::Base def user_name is_external? ? external_user_name : user.name end + + def user_name_slug + if is_external? + if external_user_name.nil? + fake_slug = "anonymous" + else + fake_slug = external_user_name.parameterize + end + public_body.url_name + "_"+fake_slug + else + user.url_name + end + end @@custom_states_loaded = false begin |