Sha256: 771f0ef0b22155da6d6d85c12e9bb0662bba8483462f3f3bae3e1973b4e12952
Contents?: true
Size: 733 Bytes
Versions: 82
Compression:
Stored size: 733 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 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
82 entries across 82 versions & 1 rubygems