Class: Workarea::Admin::ReviewViewModel
- Inherits:
-
ApplicationViewModel
- Object
- ApplicationViewModel
- Workarea::Admin::ReviewViewModel
- Defined in:
- app/view_models/workarea/admin/review_view_model.rb
Instance Method Summary collapse
Instance Method Details
#name ⇒ Object
6 7 8 9 10 11 12 |
# File 'app/view_models/workarea/admin/review_view_model.rb', line 6 def name if product.present? t('workarea.admin.reviews.index.review_for', product: product.name) else t('workarea.admin.reviews.index.review') end end |
#product ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/view_models/workarea/admin/review_view_model.rb', line 14 def product @product ||= [:product] || ProductViewModel.wrap(Catalog::Product.find(product_id)) rescue Mongoid::Errors::DocumentNotFound nil end |