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

Version Path
renalware-core-2.0.97 app/models/renalware/events/type.rb
renalware-core-2.0.96 app/models/renalware/events/type.rb
renalware-core-2.0.95 app/models/renalware/events/type.rb
renalware-core-2.0.94 app/models/renalware/events/type.rb
renalware-core-2.0.93 app/models/renalware/events/type.rb
renalware-core-2.0.92 app/models/renalware/events/type.rb
renalware-core-2.0.91 app/models/renalware/events/type.rb
renalware-core-2.0.90 app/models/renalware/events/type.rb
renalware-core-2.0.89 app/models/renalware/events/type.rb
renalware-core-2.0.88 app/models/renalware/events/type.rb
renalware-core-2.0.87 app/models/renalware/events/type.rb
renalware-core-2.0.86 app/models/renalware/events/type.rb
renalware-core-2.0.85 app/models/renalware/events/type.rb
renalware-core-2.0.84 app/models/renalware/events/type.rb
renalware-core-2.0.83 app/models/renalware/events/type.rb
renalware-core-2.0.82 app/models/renalware/events/type.rb
renalware-core-2.0.81 app/models/renalware/events/type.rb
renalware-core-2.0.80 app/models/renalware/events/type.rb
renalware-core-2.0.79 app/models/renalware/events/type.rb
renalware-core-2.0.78 app/models/renalware/events/type.rb