Place below associations

This commit is contained in:
Jorge Manrubia
2025-04-21 14:48:07 +02:00
parent ccd98f6d98
commit 491e743c27
+2 -2
View File
@@ -3,8 +3,6 @@ class Card < ApplicationRecord
Messages, Notifiable, Pinnable, Closeable, Searchable, Staged,
Statuses, Taggable, Watchable
has_markdown :description
belongs_to :collection, touch: true
belongs_to :creator, class_name: "User", default: -> { Current.user }
@@ -12,6 +10,8 @@ class Card < ApplicationRecord
has_one_attached :image, dependent: :purge_later
has_markdown :description
scope :reverse_chronologically, -> { order created_at: :desc, id: :desc }
scope :chronologically, -> { order created_at: :asc, id: :asc }
scope :latest, -> { order updated_at: :desc, id: :desc }