diff --git a/app/models/version.rb b/app/models/version.rb index 8e5e5364a..09b21d8e9 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -203,7 +203,7 @@ class Version < ActiveRecord::Base ["(CASE WHEN #{table}.effective_date IS NULL THEN 1 ELSE 0 END)", "#{table}.effective_date", "#{table}.name", "#{table}.id"] end - scope :sorted, order(fields_for_order_statement) + scope :sorted, lambda { order(fields_for_order_statement) } # Returns the sharings that +user+ can set the version to def allowed_sharings(user = User.current)