public
Description: A weekly update about GitHub!
Homepage: http://github.com/blog
Clone URL: git://github.com/qrush/rebase.git
rebase / event.rb
100644 19 lines (14 sloc) 0.458 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'active_record'
 
 
class Event < ActiveRecord::Base
class << self
def kinds
all(:group => :kind, :select => :kind).map(&:kind)
end
 
def max_daily_commits
count(:group => 'date(published)', :conditions => "kind = 'committed'").map(&:last).max
end
end
end
 
ActiveRecord::Base.logger = Logger.new(STDOUT) if 'irb' == $0
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :dbfile => DB)
ActiveRecord::Migration.verbose = false