Sha256: 9dfd4029e9fdea2230b8a03f233ae2c9c8bf7f70682577b080bdffc0dae9be1b
Contents?: true
Size: 784 Bytes
Versions: 59
Compression:
Stored size: 784 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/events" module Renalware module Events class Type < ApplicationRecord self.table_name = "event_types" DEFAULT_EVENT_CLASS_NAME = "Renalware::Events::Simple" acts_as_paranoid validates :name, presence: true, uniqueness: true validates :slug, format: { with: /\A[0-9a-z\-\_]+\z/i, case_sensitive: false }, uniqueness: true, allow_nil: true scope :visible, -> { where(hidden: false) } def self.policy_class BasePolicy end def to_s name end def event_class_name super || DEFAULT_EVENT_CLASS_NAME end end end end
Version data entries
59 entries across 59 versions & 1 rubygems