Initial commit
This commit is contained in:
commit
0cec39413f
116 changed files with 9683 additions and 0 deletions
11
app/presenters/books_presenter.rb
Normal file
11
app/presenters/books_presenter.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
class BooksPresenter < SimpleDelegator
|
||||
include ActiveSupport::NumberHelper
|
||||
|
||||
def price
|
||||
number_to_currency(super / 100)
|
||||
end
|
||||
|
||||
def authors
|
||||
super.map { |author| "#{author.first_name} #{author.last_name}" }.join(', ')
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue