Sha256: c505be660178d4c0600cb54825f1be331f0e033806228ace14d7a9521c4cd01e

Contents?: true

Size: 253 Bytes

Versions: 2

Compression:

Stored size: 253 Bytes

Contents

# frozen_string_literal: true

require 'ditty/models/base'

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

    many_to_many :users

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ditty-0.2.1 lib/ditty/models/role.rb
ditty-0.2.0 lib/ditty/models/role.rb