aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-06-26 11:13:38 -0700
committerLouise Crow <louise.crow@gmail.com>2013-06-26 11:13:38 -0700
commit411aee219e14fe3d942699f230f7a8e3ed70bfe0 (patch)
treecbd41460afc2f0e24d7490d3034eee2544f3bac5 /app/controllers/application_controller.rb
parent9ccc03bc7d4c4e9064a9217d6e332abfb3f15b7f (diff)
parent0d9de53bdccf20cc2884f0ad896d5e9dd2edee03 (diff)
Merge branch 'release/0.12' into wdtk
Conflicts: locale/he_IL/app.po locale/hr_HR/app.po locale/nb_NO/app.po locale/uk/app.po spec/models/info_request_spec.rb
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb19
1 files changed, 13 insertions, 6 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index acf366bfb..88b107861 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -363,12 +363,15 @@ class ApplicationController < ActionController::Base
# Peform the search
@per_page = per_page
- if this_page.nil?
- @page = get_search_page_from_params
- else
- @page = this_page
- end
- result = InfoRequest.full_search(models, @query, order, ascending, collapse, @per_page, @page)
+ @page = this_page || get_search_page_from_params
+
+ result = ActsAsXapian::Search.new(models, @query,
+ :offset => (@page - 1) * @per_page,
+ :limit => @per_page,
+ :sort_by_prefix => order,
+ :sort_by_ascending => ascending,
+ :collapse_by_prefix => collapse
+ )
result.results # Touch the results to load them, otherwise accessing them from the view
# might fail later if the database has subsequently been reopened.
return result
@@ -542,6 +545,10 @@ class ApplicationController < ActionController::Base
return country
end
+ def alaveteli_git_commit
+ `git log -1 --format="%H"`.strip
+ end
+
# URL generating functions are needed by all controllers (for redirects),
# views (for links) and mailers (for use in emails), so include them into
# all of all.