aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/track_thing.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-08-26 09:48:01 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-08-29 09:44:33 +0100
commit5f0c0d59ded4301efa085c4103b84a42a9fa61f6 (patch)
treef759c7d7fee8a7004b5d94b5144d37fe512534cf /app/models/track_thing.rb
parentd5384ba1b739c7ca3a8fcab4cdda35965d33c6ee (diff)
Further work in progress on better search functionality
Diffstat (limited to 'app/models/track_thing.rb')
-rw-r--r--app/models/track_thing.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb
index f993b4fe8..1cd957549 100644
--- a/app/models/track_thing.rb
+++ b/app/models/track_thing.rb
@@ -105,9 +105,19 @@ class TrackThing < ActiveRecord::Base
return track_thing
end
- def TrackThing.create_track_for_search_query(query)
+ def TrackThing.create_track_for_search_query(query, variety_postfix = nil)
track_thing = TrackThing.new
track_thing.track_type = 'search_query'
+ if !(query =~ /variety:/)
+ case variety_postfix
+ when "requests"
+ query += " variety:sent"
+ when "users"
+ query += " variety:user"
+ when "authorities"
+ query += " variety:authority"
+ end
+ end
track_thing.track_query = query
return track_thing
end