10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/acts_as_footprintable/extenders/footprintable.rb', line 10
def
require 'acts_as_footprintable/footprintable'
include ActsAsFootprintable::Footprintable
class_eval do
def self.
true
end
def self.access_ranking(range = nil, limit = nil)
records = Footprint.for_type(self)
records = records.where(created_at: range) unless range.nil?
records = records.limit(limit) unless limit.nil?
records.group(:footprintable_id).order('count_footprintable_id desc').count(:footprintable_id)
end
end
end
|