Files
fizzy/app/models/bubble.rb
T
Jason Zimdars 56c7fe4abb Add assignees to a bubble WIP
- Still needs UI to display multiple assignees
- Still needs UI for changing/removing assignees
2024-09-17 17:10:23 -05:00

20 lines
587 B
Ruby

class Bubble < ApplicationRecord
belongs_to :creator, class_name: "User", default: -> { Current.user }
has_many :comments, dependent: :destroy
has_many :boosts, dependent: :destroy
has_many :taggings, dependent: :destroy
has_many :tags, through: :taggings
has_many :assignments, dependent: :destroy
has_many :assignees, through: :assignments, source: :user
has_one_attached :image, dependent: :purge_later
enum :color, %w[
#BF1B1B #ED3F1C #ED8008 #7C956B
#698F9C #3B4B59 #5D618F #3B3633 #67695E
].index_by(&:itself), suffix: true, default: "#698F9C"
end