Adds Version.fields_for_order_statement.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10072 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-07-24 16:32:39 +00:00
parent 0b31c8ac85
commit 44fcc8919d
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -184,6 +184,11 @@ class Version < ActiveRecord::Base
end
end
def self.fields_for_order_statement(table=nil)
table ||= table_name
%w(effective_date name).map {|field| "#{table}.#{field}"}
end
# Returns the sharings that +user+ can set the version to
def allowed_sharings(user = User.current)
VERSION_SHARINGS.select do |s|