summaryrefslogtreecommitdiff
path: root/app/models/oauth_access_token.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/oauth_access_token.rb')
-rw-r--r--app/models/oauth_access_token.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/oauth_access_token.rb b/app/models/oauth_access_token.rb
index 0aa920fa828..9789d8ed62b 100644
--- a/app/models/oauth_access_token.rb
+++ b/app/models/oauth_access_token.rb
@@ -6,6 +6,8 @@ class OauthAccessToken < Doorkeeper::AccessToken
alias_attribute :user, :resource_owner
+ scope :distinct_resource_owner_counts, ->(applications) { where(application: applications).distinct.group(:application_id).count(:resource_owner_id) }
+
def scopes=(value)
if value.is_a?(Array)
super(Doorkeeper::OAuth::Scopes.from_array(value).to_s)