summaryrefslogtreecommitdiffstats
path: root/app/models/wiki_page.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-07 17:59:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-07 17:59:20 +0000
commit7222e4012db58c53d364e3b065e70338c094e878 (patch)
tree2d0a723b9d9030591967b9932587fb5987062ce0 /app/models/wiki_page.rb
parent4896d5c7e83bb3cc7996c5ab09441c90e7cd9ce1 (diff)
downloadredmine-7222e4012db58c53d364e3b065e70338c094e878.tar.gz
redmine-7222e4012db58c53d364e3b065e70338c094e878.zip
Rewrites named scopes with ARel queries.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10950 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/wiki_page.rb')
-rw-r--r--app/models/wiki_page.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index 45954a08d..31b8845a3 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -49,10 +49,10 @@ class WikiPage < ActiveRecord::Base
before_save :handle_redirects
# eager load information about last updates, without loading text
- scope :with_updated_on, lambda { {
- :select => "#{WikiPage.table_name}.*, #{WikiContent.table_name}.updated_on, #{WikiContent.table_name}.version",
- :joins => "LEFT JOIN #{WikiContent.table_name} ON #{WikiContent.table_name}.page_id = #{WikiPage.table_name}.id"
- } }
+ scope :with_updated_on, lambda {
+ select("#{WikiPage.table_name}.*, #{WikiContent.table_name}.updated_on, #{WikiContent.table_name}.version").
+ joins("LEFT JOIN #{WikiContent.table_name} ON #{WikiContent.table_name}.page_id = #{WikiPage.table_name}.id")
+ }
# Wiki pages that are protected by default
DEFAULT_PROTECTED_PAGES = %w(sidebar)