Class: ReviewCell

Inherits:
Cell::ViewModel
  • Object
show all
Includes:
Kaminari::Helpers::HelperMethods
Defined in:
app/cells/review_cell.rb

Overview

for collections of review, pass `restaurant` option

Instance Method Summary collapse

Instance Method Details

#comment ⇒ Object



36
37
38
# File 'app/cells/review_cell.rb', line 36

def comment
  model.review
end

#index ⇒ Object



11
12
13
# File 'app/cells/review_cell.rb', line 11

def index
  render :index
end

#overall_rating ⇒ Object



20
21
22
# File 'app/cells/review_cell.rb', line 20

def overall_rating
  model.rating
end

#photos ⇒ Object



40
41
42
# File 'app/cells/review_cell.rb', line 40

def photos
  model.review_photos
end

#ratings ⇒ Object



44
45
46
47
48
49
50
# File 'app/cells/review_cell.rb', line 44

def ratings
  if model.reservation.service_type == 'dine_in'
    %w(overall food ambience service value)
  else
    %w(overall food value packaging delivery_service)
  end
end


32
33
34
# File 'app/cells/review_cell.rb', line 32

def recommended_fors
  model.review_recommended_fors.includes(:dimension)&.map(&:dimension)&.map(&:identifier) || []
end

#reviews ⇒ Object

Index page uses this



16
17
18
# File 'app/cells/review_cell.rb', line 16

def reviews
  model
end