has_one allows for touch: true

This commit is contained in:
Jose Farias
2024-10-25 15:25:57 -06:00
parent 9a562d8ab1
commit 46c2b450da
+1 -3
View File
@@ -4,10 +4,8 @@ module Messageable
TYPES = %w[ Comment EventSummary ]
included do
has_one :message, as: :messageable
has_one :message, as: :messageable, touch: true
after_create -> { create_message! bubble: bubble }
after_update -> { message.touch }
after_touch -> { message.touch }
end
end