We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef72704 commit 3687747Copy full SHA for 3687747
spec/models/message.rb
@@ -6,9 +6,9 @@ class Message
6
field :to
7
8
if Mongoid::Compatibility::Version.mongoid6_or_newer?
9
- belongs_to :user, optional: true
+ belongs_to :user, optional: true, touch: true
10
else
11
- belongs_to :user, touch: true
+ belongs_to :user
12
end
13
14
validates :identifier, uniqueness: { message: 'uniqueness' }
spec/unit/associations_spec.rb
@@ -48,7 +48,7 @@
48
49
describe Message do
50
51
- it { is_expected.to belong_to(:user).with_optional }
+ it { is_expected.to belong_to(:user).with_optional.with_touch(true) }
52
53
54
0 commit comments