Sha256: 7373d8cb835558ee11335c80c5b13b53289d6b37656bb056c9e7c18831ce209d

Contents?: true

Size: 567 Bytes

Versions: 6

Compression:

Stored size: 567 Bytes

Contents

# frozen_string_literal: true

module DoorkeeperMongodb
  module Shared
    module Scopes
      extend ActiveSupport::Concern

      included do
        field :scopes, type: String
      end

      def scopes=(value)
        scopes = if value.is_a?(Array)
                   Doorkeeper::OAuth::Scopes.from_array(value).to_s
                 else
                   Doorkeeper::OAuth::Scopes.from_string(value.to_s).to_s
                 end

        write_attribute :scopes, scopes
      end

      def scopes_string
        self[:scopes]
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
doorkeeper-mongodb-5.4.0 lib/doorkeeper-mongodb/shared/scopes.rb
doorkeeper-mongodb-5.3.0 lib/doorkeeper-mongodb/shared/scopes.rb
doorkeeper-mongodb-5.2.3 lib/doorkeeper-mongodb/shared/scopes.rb
doorkeeper-mongodb-5.2.2 lib/doorkeeper-mongodb/shared/scopes.rb
doorkeeper-mongodb-5.2.1 lib/doorkeeper-mongodb/shared/scopes.rb
doorkeeper-mongodb-5.2.0 lib/doorkeeper-mongodb/shared/scopes.rb