Skip to content

Commit 8fe4eea

Browse files
authored
Merge pull request #752 from dosyfier/fix-gitcache-404
Fix #715 by correcting misuse of ActiveRecord API for GitCache objects
2 parents 3427246 + 21df0cf commit 8fe4eea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lib/redmine_git_hosting/cache/database.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def clear_cache_for_repository(repo_id)
4747
end
4848

4949
def apply_cache_limit
50-
GitCache.find(:last, order: 'created_at DESC').destroy if max_cache_elements >= 0 && GitCache.count > max_cache_elements
50+
GitCache.order(:created_at).first.destroy if max_cache_elements >= 0 && GitCache.count > max_cache_elements
5151
end
5252
end
5353
end

0 commit comments

Comments
 (0)