Project

General

Profile

Patch #24839 ยป use-exists-instead-of-count.diff

Go MAEDA, 2017-01-16 15:57

View differences:

app/models/repository/git.rb (working copy)
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
app/views/trackers/index.html.erb (working copy)
<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>
app/views/versions/show.html.erb (working copy)
<% end %>
<div id="status_by">
<%= render_issue_status_by(@version, params[:status_by]) if @version.fixed_issues.count > 0 %>
<%= render_issue_status_by(@version, params[:status_by]) if @version.fixed_issues.exists? %>
</div>
</div>
    (1-1/1)