Class: Logman::Log
- Inherits:
-
Object
- Object
- Logman::Log
- Includes:
- Mongoid::Document, Mongoid::Timestamps::Created
- Defined in:
- lib/models/log.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.count_on_date(date) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/models/log.rb', line 21 def self.count_on_date(date) # begin # raise date.to_s start_time = Time.new(date.year, date.month, date.day, 0,0,0).utc end_time = start_time + 1.day count = 0 Bucket.all.each do |b| count += b.logs.between(created_at: start_time..end_time).count end count # # rescue # 0 # end end |
Instance Method Details
#serializable_hash(options = {}) ⇒ Object
to json
40 41 42 43 |
# File 'lib/models/log.rb', line 40 def serializable_hash(={}) [:methods] ||= [:id] super() end |