rubocop corrections

This commit is contained in:
Karol Selak 2021-03-22 03:16:29 +01:00
parent c63c6bc448
commit de29815686
72 changed files with 468 additions and 311 deletions

View file

@ -1,7 +1,10 @@
# frozen_string_literal: true
module BooksHelper
def cart_summary
number_to_currency(@books.map{ |b| b.price }.reduce(:+))
number_to_currency(@books.map(&:price).reduce(:+))
end
def can_book_be_added?(book)
logged_in? && book.quantity.positive? && !current_user.books.exists?(book.id)
end