Class: Workarea::Storefront::ReviewViewModel
- Inherits:
-
ApplicationViewModel
- Object
- ApplicationViewModel
- Workarea::Storefront::ReviewViewModel
- Defined in:
- app/view_models/workarea/storefront/review_view_model.rb
Instance Method Summary collapse
Instance Method Details
#anonymous? ⇒ Boolean
8 9 10 |
# File 'app/view_models/workarea/storefront/review_view_model.rb', line 8 def anonymous? model.anonymous? || user.nil? end |
#requires_public_info? ⇒ Boolean
4 5 6 |
# File 'app/view_models/workarea/storefront/review_view_model.rb', line 4 def requires_public_info? anonymous? || user&.public_info.blank? end |
#user ⇒ Object
12 13 14 15 16 17 |
# File 'app/view_models/workarea/storefront/review_view_model.rb', line 12 def user return if model.anonymous? return @user if defined?(@user) @user = User.find(user_id) rescue nil end |