Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git-scm.com.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2022-10-05 14:35:16 +0300
committerJeff King <peff@peff.net>2022-10-05 16:28:15 +0300
commit01edd94fb94527396bb613e588115c9b9e264801 (patch)
tree3595e184e431d047d43358883f4f0dc34d462099
parentdc10b4fd5fa44c193113fd58b42cfa4d9790c72a (diff)
appease rubocop Naming/PredicateName
-rw-r--r--app/models/book.rb2
-rw-r--r--app/views/books/show.html.erb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/book.rb b/app/models/book.rb
index 260a58f0..884e304c 100644
--- a/app/models/book.rb
+++ b/app/models/book.rb
@@ -43,7 +43,7 @@ class Book < ApplicationRecord
@@all_books
end
- def has_edition(number)
+ def edition?(number)
Book.where(edition: number, code: code).count > 0
end
end
diff --git a/app/views/books/show.html.erb b/app/views/books/show.html.erb
index 7707eb4e..762722f5 100644
--- a/app/views/books/show.html.erb
+++ b/app/views/books/show.html.erb
@@ -35,7 +35,7 @@
<div class="book-wrapper">
<img src="/images/books/pro-git@2x.jpg" width="118" height="157"/>
<div>1st Edition (2009)</div>
- <% if @book.has_edition(2) %>
+ <% if @book.edition?(2) %>
<div class="switch"><a href="/book/<%= @book.code %>/v2">Switch to 2nd Edition</a></div>
<% end %>
</div>