Sha256: 86ef292ee3f2cf2f8ba3c309f9ee57de496cb02f94bb8b1bd2b397d6ee5c962c

Contents?: true

Size: 487 Bytes

Versions: 1

Compression:

Stored size: 487 Bytes

Contents

# frozen_string_literal: true

module PUNK
  # @model
  # @property id(required) [string] a unique identifier for the group
  # @property name(required) [string] the name of the group
  # @property icon(required) [string] an image URL
  class Group < PUNK::Model
    alias_method :to_s, :name

    many_to_one :tenant
    many_to_many :users

    def validate
      validates_presence :tenant
      validates_presence :name
      validates_url :icon, allow_blank: true
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
punk-0.4.1 lib/punk/models/group.rb