about summary refs log tree commit diff
path: root/app/models/list.rb
blob: 5d7ba0065a4dca492e35f9af44eea46668fc2322 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true
# == Schema Information
#
# Table name: lists
#
#  id         :integer          not null, primary key
#  account_id :integer
#  title      :string           default(""), not null
#  created_at :datetime         not null
#  updated_at :datetime         not null
#

class List < ApplicationRecord
  include Paginable

  belongs_to :account

  has_many :list_accounts, inverse_of: :list, dependent: :destroy
  has_many :accounts, through: :list_accounts

  validates :title, presence: true
end