diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-01-16 18:12:49 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-01-16 18:12:49 +0000 |
commit | c7f03c00a92289f743298cf9bd0b4a13b0ac3fae (patch) | |
tree | 11074e95ce66da5116347795902892bd6c8fba0b | |
parent | 62c7d1142721da79fe3c604e5fdaaa83031a6fa2 (diff) | |
download | redmine-c7f03c00a92289f743298cf9bd0b4a13b0ac3fae.tar.gz redmine-c7f03c00a92289f743298cf9bd0b4a13b0ac3fae.zip |
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
-rw-r--r-- | app/models/repository/git.rb | 2 | ||||
-rw-r--r-- | app/views/trackers/index.html.erb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb index 26e0d393d..195c87800 100644 --- a/app/models/repository/git.rb +++ b/app/models/repository/git.rb @@ -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 diff --git a/app/views/trackers/index.html.erb b/app/views/trackers/index.html.erb index 5f40cf0ee..7ee6387fd 100644 --- a/app/views/trackers/index.html.erb +++ b/app/views/trackers/index.html.erb @@ -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> |