Sha256: 6eb28a7f5f147177ecbab3b783e3bf623ecede061ce44f4bd5e811a9ffeea308
Contents?: true
Size: 766 Bytes
Versions: 3
Compression:
Stored size: 766 Bytes
Contents
module Doorkeeper module Models module Mongoid2 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 end end end end end end
Version data entries
3 entries across 3 versions & 3 rubygems