Files
fizzy/app/models/collection.rb
T
2025-04-25 13:29:16 +02:00

12 lines
352 B
Ruby

class Collection < ApplicationRecord
include AutoClosing, Accessible, Broadcastable, Filterable, Workflowing
belongs_to :creator, class_name: "User", default: -> { Current.user }
has_many :cards, dependent: :destroy
has_many :tags, -> { distinct }, through: :cards
has_many :events
scope :alphabetically, -> { order("lower(name)") }
end