提交 e06e5633 编写于 作者: D Dmitriy Zaporozhets

Refactor Project.abandoned method

上级 4daf68b5
......@@ -110,11 +110,7 @@ class Project < ActiveRecord::Base
class << self
def abandoned
project_ids = Event.select('max(created_at) as latest_date, project_id').
group('project_id').
having('latest_date < ?', 6.months.ago).map(&:project_id)
where(id: project_ids)
where('projects.last_activity_at < ?', 6.months.ago)
end
def with_push
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册