Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Use exists? instead of count (#24839).
Browse files Browse the repository at this point in the history
Patch by Vincent Robert and Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@16211 e93f8b46-1217-0410-a6f0-8f06a7374b81
  • Loading branch information
jplang authored and stucki committed Aug 18, 2020
1 parent 433040f commit 58347c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/repository/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def fetch_changesets
return if prev_db_heads.sort == repo_heads.sort

h["db_consistent"] ||= {}
if changesets.count == 0
if ! changesets.exists?
h["db_consistent"]["ordering"] = 1
merge_extra_info(h)
self.save
Expand Down
2 changes: 1 addition & 1 deletion app/views/trackers/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<tr class="<%= cycle("odd", "even") %>">
<td class="name"><%= link_to tracker.name, edit_tracker_path(tracker) %></td>
<td>
<% unless tracker.workflow_rules.count > 0 %>
<% unless tracker.workflow_rules.exists? %>
<span class="icon icon-warning">
<%= l(:text_tracker_no_workflow) %> (<%= link_to l(:button_edit), workflows_edit_path(:tracker_id => tracker) %>)
</span>
Expand Down

0 comments on commit 58347c7

Please sign in to comment.