Skip to content
Snippets Groups Projects
Commit e06e5633 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Refactor Project.abandoned method

parent 4daf68b5
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment