Sha256: f4ff946137dc63656b4bd9fc5e08cb0393da9844ec1419aad5b499333201a82c

Contents?: true

Size: 284 Bytes

Versions: 5

Compression:

Stored size: 284 Bytes

Contents

# frozen_string_literal: true

require 'ditty/models/base'

module Ditty
  class Role < ::Sequel::Model
    include ::Ditty::Base
    plugin :tree

    many_to_many :users

    def validate
      super
      validates_presence [:name]
      validates_unique [:name]
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ditty-0.11.1 lib/ditty/models/role.rb
ditty-0.10.2 lib/ditty/models/role.rb
ditty-0.10.1 lib/ditty/models/role.rb
ditty-0.9.1 lib/ditty/models/role.rb
ditty-0.9.0 lib/ditty/models/role.rb