Browse Source

Use exists? instead of count (#24839).

Patch by Vincent Robert and Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@16211 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/3.4.0
Jean-Philippe Lang 7 years ago
parent
commit
c7f03c00a9
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      app/models/repository/git.rb
  2. 1
    1
      app/views/trackers/index.html.erb

+ 1
- 1
app/models/repository/git.rb View File

@@ -143,7 +143,7 @@ class Repository::Git < Repository
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

+ 1
- 1
app/views/trackers/index.html.erb View File

@@ -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>

Loading…
Cancel
Save