mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 17:56:11 +02:00
Adds the date of the last activity to the list of available columns for Projects (#23954).
Patch by Frederico Camara (@fredsdc) and Marius BĂLTEANU (@marius.balteanu). git-svn-id: https://svn.redmine.org/redmine/trunk@22811 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -64,9 +64,8 @@ module Redmine
|
||||
ActiveSupport::Deprecation.warn "acts_as_activity_provider with implicit :scope option is deprecated. Please pass a scope on the #{self.name} as a proc."
|
||||
end
|
||||
|
||||
if from && to
|
||||
scope = scope.where("#{provider_options[:timestamp]} BETWEEN ? AND ?", from, to)
|
||||
end
|
||||
scope = scope.where("#{provider_options[:timestamp]} >= ?", from) if from
|
||||
scope = scope.where("#{provider_options[:timestamp]} <= ?", to) if to
|
||||
|
||||
if options[:author]
|
||||
return [] if provider_options[:author_key].nil?
|
||||
@@ -87,6 +86,10 @@ module Redmine
|
||||
scope = scope.where(Project.allowed_to_condition(user, "view_#{self.name.underscore.pluralize}".to_sym, options))
|
||||
end
|
||||
|
||||
if options[:last_by_project]
|
||||
scope = scope.group("#{Project.table_name}.id").maximum(provider_options[:timestamp])
|
||||
end
|
||||
|
||||
scope.to_a
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user