Use lambda form in model scopes (#12499)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10949 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
8201761e77
commit
4896d5c7e8
12 files changed
+19
-19
No files matched your search
@@ -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, {
|
||||
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)
|
||||
|
||||
Reference in new issue
Block a user