use-exists-instead-of-count.diff

Go MAEDA, 2017-01-16 15:57

Download (1.54 KB)

View differences:

app/models/repository/git.rb (working copy)
143 143
    return if prev_db_heads.sort == repo_heads.sort
144 144

  
145 145
    h["db_consistent"]  ||= {}
146
    if changesets.count == 0
146
    if ! changesets.exists?
147 147
      h["db_consistent"]["ordering"] = 1
148 148
      merge_extra_info(h)
149 149
      self.save
app/views/trackers/index.html.erb (working copy)
16 16
  <tr class="<%= cycle("odd", "even") %>">
17 17
  <td class="name"><%= link_to tracker.name, edit_tracker_path(tracker) %></td>
18 18
  <td>
19
    <% unless tracker.workflow_rules.count > 0 %>
19
    <% unless tracker.workflow_rules.exists? %>
20 20
      <span class="icon icon-warning">
21 21
        <%= l(:text_tracker_no_workflow) %> (<%= link_to l(:button_edit), workflows_edit_path(:tracker_id => tracker) %>)
22 22
      </span>
app/views/versions/show.html.erb (working copy)
32 32
<% end %>
33 33

  
34 34
<div id="status_by">
35
<%= render_issue_status_by(@version, params[:status_by]) if @version.fixed_issues.count > 0 %>
35
<%= render_issue_status_by(@version, params[:status_by]) if @version.fixed_issues.exists? %>
36 36
</div>
37 37
</div>
38 38