Sha256: a526d06e21521b26062e118a3d93a115144319d08b2d162beb3e2459bcfb5a30
Contents?: true
Size: 784 Bytes
Versions: 12
Compression:
Stored size: 784 Bytes
Contents
module Doorkeeper module Models module Mongoid3 module Scopes extend ActiveSupport::Concern # It's strange that if not define these after included will raise error # in Mongoid 2 and 3, but 4 works well see: # https://travis-ci.org/jasl/doorkeeper/builds/31586902 included do def scopes OAuth::Scopes.from_string(self[:scopes]) end def scopes_string self[:scopes] end def includes_scope?(*required_scopes) required_scopes.blank? || required_scopes.any? { |s| scopes.exists?(s.to_s) } end def scopes=(value) write_attribute :scopes, value if value.present? end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems