Sha256: 7b952864f39416af445ae65c30325af938272874c334f7ddfd270c31a6b4e7a8
Contents?: true
Size: 563 Bytes
Versions: 5
Compression:
Stored size: 563 Bytes
Contents
# frozen_string_literal: true module Doorkeeper module Models module Ownership extend ActiveSupport::Concern included do belongs_to_options = { polymorphic: true } if defined?(ActiveRecord::Base) && ActiveRecord::VERSION::MAJOR >= 5 belongs_to_options[:optional] = true end belongs_to :owner, belongs_to_options validates :owner, presence: true, if: :validate_owner? end def validate_owner? Doorkeeper.configuration.confirm_application_owner? end end end end
Version data entries
5 entries across 5 versions & 1 rubygems