rostra 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/rostra/question.rb +8 -6
- data/lib/rostra/version.rb +1 -1
- metadata +1 -1
@@ -15,13 +15,15 @@ module Rostra
|
|
15
15
|
# Finds questions asked within the last 15 days ordered by non-unique page views.
|
16
16
|
#
|
17
17
|
def self.trending(limit = 5)
|
18
|
-
return [] if Question.count.zero?
|
19
18
|
Question
|
20
|
-
.where(created_at: (15.days.ago)..(Time.now))
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
.where(created_at: (15.days.ago)..(Time.now)).limit(limit)
|
20
|
+
|
21
|
+
# Question
|
22
|
+
# .where(created_at: (15.days.ago)..(Time.now))
|
23
|
+
# .limit(limit)
|
24
|
+
# .joins(:impressions)
|
25
|
+
# .group('impressions.impressionable_id')
|
26
|
+
# .order('count(impressions.impressionable_id) desc')
|
25
27
|
end
|
26
28
|
|
27
29
|
def answer_count
|
data/lib/rostra/version.rb
CHANGED