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.77 app/models/renalware/events/type.rb
renalware-core-2.0.76 app/models/renalware/events/type.rb
renalware-core-2.0.75 app/models/renalware/events/type.rb
renalware-core-2.0.74 app/models/renalware/events/type.rb
renalware-core-2.0.73 app/models/renalware/events/type.rb
renalware-core-2.0.72 app/models/renalware/events/type.rb
renalware-core-2.0.71 app/models/renalware/events/type.rb
renalware-core-2.0.70 app/models/renalware/events/type.rb
renalware-core-2.0.69 app/models/renalware/events/type.rb
renalware-core-2.0.68 app/models/renalware/events/type.rb
renalware-core-2.0.67 app/models/renalware/events/type.rb
renalware-core-2.0.64 app/models/renalware/events/type.rb
renalware-core-2.0.63 app/models/renalware/events/type.rb
renalware-core-2.0.62 app/models/renalware/events/type.rb
renalware-core-2.0.61 app/models/renalware/events/type.rb
renalware-core-2.0.60 app/models/renalware/events/type.rb
renalware-core-2.0.58 app/models/renalware/events/type.rb
renalware-core-2.0.57 app/models/renalware/events/type.rb
renalware-core-2.0.56 app/models/renalware/events/type.rb
renalware-core-2.0.55 app/models/renalware/events/type.rb