Skip to content

Instantly share code, notes, and snippets.

@bogdan
Created July 1, 2011 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bogdan/8b91694edec900de84be to your computer and use it in GitHub Desktop.
Save bogdan/8b91694edec900de84be to your computer and use it in GitHub Desktop.
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