about summary refs log tree commit diff
path: root/app/models/concerns/paginable.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-09-01 17:36:30 +0200
committerGitHub <noreply@github.com>2020-09-01 17:36:30 +0200
commitd967251fdc3826ad27d30e55258cfa4cdfd7c871 (patch)
tree91926ccaedf470bfef058cc7156f9f362d46186a /app/models/concerns/paginable.rb
parentd95dd3883e0c7d1626f5e3b88d24af2627a641e2 (diff)
parent787a629b8f1df4cce53a9de7f3aa668cc9ef632f (diff)
Merge pull request #1417 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models/concerns/paginable.rb')
-rw-r--r--app/models/concerns/paginable.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/concerns/paginable.rb b/app/models/concerns/paginable.rb
index 8863094f7..760cc3df4 100644
--- a/app/models/concerns/paginable.rb
+++ b/app/models/concerns/paginable.rb
@@ -20,12 +20,12 @@ module Paginable
       query
     }
 
-    scope :paginate_by_id, ->(limit, options = {}) {
+    def self.to_a_paginated_by_id(limit, options = {})
       if options[:min_id].present?
         paginate_by_min_id(limit, options[:min_id]).reverse
       else
-        paginate_by_max_id(limit, options[:max_id], options[:since_id])
+        paginate_by_max_id(limit, options[:max_id], options[:since_id]).to_a
       end
-    }
+    end
   end
 end