Guest User

Untitled

a guest
Jun 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. starttime = options[:starttime].blank? ? Time.now.midnight : options[:starttime]
  2. endtime = options[:endtime].blank? ? 1.day.from_now : options[:endtime]
  3. total_entries = DetectedChange.count(include: :device, starttime: starttime, endtime: endtime) if options[:total_entries].blank?
  4. return 0 if total_entries == 0
  5. rows = DetectedChange.paginate(:all,include: :device,starttime: starttime, endtime: endtime,page: start,
  6. per_page: limit, total_entries: total_entries)
Add Comment
Please, Sign In to add comment