Class: ReviewRecommendedFor
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ReviewRecommendedFor
- Defined in:
- app/models/review_recommended_for.rb
Overview
typed: ignore In second step of rating reservation feature there is a question:
What do you recommend this restaurant for?
* Solo dining
* Couple
* Family
* Friends
* Business
* Special Occasion
So because of this reason, instead of save those data in serialized array (in Ruby/Yaml format) we store each value in this table to make it searchable using MySQL query
However this model doesn't store the name, we have to create Dimension's record first for example:
family = Dimension.find_or_create_by name: 'family'
review = Review.find X
ReviewRecommendedFor.create(review: review, dimension: family)