Sha256: b353adff75d2acbe23ab661c0dedc9e954ce607d4f3a421bb4eb3eef94a15219

Contents?: true

Size: 582 Bytes

Versions: 1

Compression:

Stored size: 582 Bytes

Contents

# frozen_string_literal: true

module ForemanResourceQuota
  module UserExtensions
    extend ActiveSupport::Concern
    included do
      has_many :resource_quota_users, class_name: 'ForemanResourceQuota::ResourceQuotaUser', dependent: :destroy,
        inverse_of: :user
      has_many :resource_quotas, class_name: 'ForemanResourceQuota::ResourceQuota', through: :resource_quota_users
      attribute :resource_quota_is_optional, :boolean, default: false

      scoped_search relation: :resource_quotas, on: :name, complete_value: true, rename: :resource_quota
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
foreman_resource_quota-0.1.0 app/models/concerns/foreman_resource_quota/user_extensions.rb