Statistics
This commit is contained in:
@@ -6,6 +6,12 @@ module RakeControl
|
||||
@storage = :active_record
|
||||
end
|
||||
|
||||
def apply
|
||||
setup_storage_model
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def setup_storage_model
|
||||
case storage
|
||||
when :active_record, :activerecord
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
module RakeControl
|
||||
class Statistics
|
||||
attr_reader :name
|
||||
|
||||
def initialize(name)
|
||||
@name = name
|
||||
end
|
||||
|
||||
def last
|
||||
relation.last
|
||||
end
|
||||
|
||||
def log
|
||||
relation.all
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def relation
|
||||
Run.where(name: name)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user