diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-10-22 19:38:47 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-10-22 19:39:44 +0200 |
commit | a9e40a3d80435431f689b8d19005dd77a8f50224 (patch) | |
tree | 48573a1f1ec9c14789c529de3b8fb8badfb20444 /app/models | |
parent | 17122df80dc7e85910a9cfa049d2e33ef84288c6 (diff) |
Adding OAuth access scopes, fixing OAuth authorization UI, adding rate limiting
to the API
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/feed.rb | 2 | ||||
-rw-r--r-- | app/models/media_attachment.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/app/models/feed.rb b/app/models/feed.rb index 2bc9e980a..211d64638 100644 --- a/app/models/feed.rb +++ b/app/models/feed.rb @@ -7,7 +7,7 @@ class Feed def get(limit, max_id = nil, since_id = nil) max_id = '+inf' if max_id.blank? since_id = '-inf' if since_id.blank? - unhydrated = redis.zrevrangebyscore(key, "(#{max_id}", "(#{since_id}", limit: [0, limit], with_scores: true).collect(&:last).map(&:to_i) + unhydrated = redis.zrevrangebyscore(key, "(#{max_id}", "(#{since_id}", limit: [0, limit], with_scores: true).map(&:last).map(&:to_i) # If we're after most recent items and none are there, we need to precompute the feed if unhydrated.empty? && max_id == '+inf' && since_id == '-inf' diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index ab6c91efb..008147a08 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -34,7 +34,8 @@ class MediaAttachment < ApplicationRecord image? ? 'image' : 'video' end -private + private + def self.file_styles(f) if f.instance.image? { |