Instantly share code, notes, and snippets.

Embed
What would you like to do?
class DailyReports < BaseReport
column(:date)
column(:new_users)
column(:total_users)
column(:profiles_completed)
column(:resumes_uploaded)
column(:repeat_visitors)
column(:viewed_jobs)
column(:liked_jobs, :url => Proc.new {|model|
UrlService.liked_admin_reports_daily_report_path(:date => model.date.to_s, :format => :csv)
})
column(:applied_jobs, :url => Proc.new{|model|
UrlService.applied_admin_reports_daily_report_path(:date => model.date.to_s, :format => :csv)
})
column(:postcards_sent)
column(:comments_shared)
column(:new_applications_autotracked)
column(:total_applications_autotracked)
column(:resumes_sent_to_partners)
filter(:year, :enum, :select => (2010..Date.today.year), :include_blank => "") do |value|
self.conditions(["extract(year from date) = ?", value])
end
filter(:month, :enum, :select => Date::MONTHNAMES.enum_for(:each_with_index).collect {|name, index| [name, index]}, :include_blank => false) do |value|
self.conditions(["extract(month from date) = ?", value])
end
scope do
DailyReport
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment