popularable 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/concerns/popularable.rb +1 -1
- data/lib/popularable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d5d0056f22c9c1348639c3b615db3f61184066d
|
4
|
+
data.tar.gz: d54cf8bafe044acdcfa0858e272ad5d2a893ad47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96b141d5644a04fc72a899d2b5287da8c3d11dc2bcc9da959ec54f1e95594486bf692fd1b889681074e584cf7bad3742fda17cc2fd13228caac48d1cf344bee8
|
7
|
+
data.tar.gz: 790045a66684616d1d774c5e711b58b33dacc1aa63f9e27a01cc6558029221527908c095a77d9a23899e8b420dfb9f59de34a44813febb1dd29b6c060dadb831
|
data/lib/concerns/popularable.rb
CHANGED
@@ -26,7 +26,7 @@ module Popularable
|
|
26
26
|
}
|
27
27
|
|
28
28
|
scope :popular_since, -> (since){
|
29
|
-
select( "#{self.table_name}.*, 0 + SUM(popularable_popularity_events.popularity) AS popularity").joins( "LEFT OUTER JOIN popularable_popularity_events ON (#{self.table_name}.id = popularable_popularity_events.popularable_id AND popularable_popularity_events.popularable_type = '#{self.to_s}')").where( "popularable_popularity_events.popularity_event_date >= ?", since.to_date ).group( "#{
|
29
|
+
select( "#{self.table_name}.*, 0 + SUM(popularable_popularity_events.popularity) AS popularity").joins( "LEFT OUTER JOIN popularable_popularity_events ON (#{self.table_name}.id = popularable_popularity_events.popularable_id AND popularable_popularity_events.popularable_type = '#{self.to_s}')").where( "popularable_popularity_events.popularity_event_date >= ?", since.to_date ).group( "#{self.table_name}.id" ).order( "popularity DESC" )
|
30
30
|
}
|
31
31
|
|
32
32
|
has_many :popularable_popularity_events, as: :popularable
|
data/lib/popularable/version.rb
CHANGED