models: require belong_to associations on feedback
This commit is contained in:
parent
79fcf5e814
commit
91619b16e8
2 changed files with 2 additions and 1 deletions
|
@ -9,7 +9,7 @@
|
|||
# user_id :bigint
|
||||
#
|
||||
class Feedback < ApplicationRecord
|
||||
belongs_to :user
|
||||
belongs_to :user, optional: false
|
||||
|
||||
enum rating: {
|
||||
happy: 'happy',
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
FactoryBot.define do
|
||||
factory :feedback do
|
||||
rating { Feedback.ratings.fetch(:happy) }
|
||||
association :user
|
||||
|
||||
trait :happy do
|
||||
rating { Feedback.ratings.fetch(:happy) }
|
||||
|
|
Loading…
Reference in a new issue