Sha256: 6183b13e376a7a2ad16f80df32981a48451145f0edaaba5f938b03f738651f17
Contents?: true
Size: 787 Bytes
Versions: 35
Compression:
Stored size: 787 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/system" module Renalware module System # The desription in data of a dashboard displayed in the UI, for example # the 'default' dashboard a user see when they log in, a dashboard for # an HD nurse, or a user's customised dashboard (if we get to build that!), # A dashboard comprises components (see Component and DashboardComponent). class Dashboard < ApplicationRecord belongs_to :user has_many :dashboard_components, dependent: :restrict_with_exception has_many :components, through: :dashboard_components validates :name, uniqueness: true validates :name, presence: { if: -> { user_id.nil? } } validates :user, presence: { if: -> { name.nil? } } end end end
Version data entries
35 entries across 35 versions & 1 rubygems