Module: Models::Scopes

Included in:
Doorkeeper::AccessGrant, Doorkeeper::AccessToken, Doorkeeper::Application
Defined in:
lib/support/orm/rethinkdb/scopes.rb

Overview

Reopen to align with NoBrainer’s exclusively ‘super` overrides. ORM is thrust into an infinite loop, otherwise.

Instance Method Summary collapse

Instance Method Details

#includes_scope?(*required_scopes) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/support/orm/rethinkdb/scopes.rb', line 18

def includes_scope?(*required_scopes)
  required_scopes.blank? || required_scopes.any? { |scope| scopes.exists?(scope.to_s) }
end

#scopesObject



6
7
8
# File 'lib/support/orm/rethinkdb/scopes.rb', line 6

def scopes
  OAuth::Scopes.from_string(super)
end

#scopes=(value) ⇒ Object



10
11
12
# File 'lib/support/orm/rethinkdb/scopes.rb', line 10

def scopes=(value)
  super Array(value).join(" ")
end

#scopes_stringObject



14
15
16
# File 'lib/support/orm/rethinkdb/scopes.rb', line 14

def scopes_string
  self._read_attribute(:scopes)
end