` reviews: @ship.reviews.preload(:user_profile).map do |review|
{
id: review.id,
body: review.body,
rating: review.rating,
user_profile: review.user_profile,
comments: @review.comment.preload(:comment).map do |comment|
{
id: comment.id,
body: comment.body,
user_profile: comment.user_profile_id,
}
end
}
class Comment < ApplicationRecord
belongs_to :user_profile
belongs_to :review
end
`class Review < ApplicationRecord
belongs_to :user_profile
belongs_to :ship
has_many :comments
has_many :helpfuls
end
comments: @review.comment.preload(:comment).map do |comment|
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE