Timestamp in UTC, abstract storage

This commit is contained in:
Gregory Eremin
2013-06-07 12:32:50 +04:00
parent 861c12aa32
commit c6f0f2480d
14 changed files with 84 additions and 32 deletions
@@ -1,7 +1,7 @@
module BurdenWeb
class RunsController < ApplicationController
def index
@runs = Burden::Storage.run.where(name: params[:task_id]).order('created_at desc').limit(100)
@runs = Burden::Storage.run.history(params[:task_id])
end
end
end
@@ -13,7 +13,7 @@
<% @runs.each do |run| %>
<tr>
<td><span class="<%= task_label(run) %> radius label"><%= run.name %></span></td>
<td><%= l run.created_at, format: :short %> (<%= time_ago_in_words(run.created_at) %> ago)</td>
<td><%= l run.timestamp, format: :short %> (<%= time_ago_in_words(run.timestamp) %> ago)</td>
<td><%= run.execution_time.round(6) %>s</td>
</tr>
<% end %>
@@ -12,8 +12,8 @@
<% @tasks.each do |run| %>
<tr>
<td><span class="<%= task_label(run) %> radius label"><%= run.name %></span></td>
<% if run.created_at %>
<td><%= time_ago_in_words(run.created_at) %> ago</td>
<% if run.timestamp %>
<td><%= time_ago_in_words(run.timestamp) %> ago</td>
<td><%= run.execution_time.round(6) %>s</td>
<td><%= link_to 'Run', run_task_path(run.name, back: tasks_path), class: 'small radius button' %></td>
<td><%= link_to 'History', task_runs_path(run.name), class: 'secondary small radius button' %></td>
@@ -4,7 +4,7 @@ class CreateBurdenRuns < ActiveRecord::Migration
t.string :name
t.boolean :success
t.float :execution_time
t.timestamps
t.datetime :timestamp
end
end
+2 -3
View File
@@ -11,14 +11,13 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130607070108) do
ActiveRecord::Schema.define(:version => 20130607082646) do
create_table "burden_runs", :force => true do |t|
t.string "name"
t.boolean "success"
t.float "execution_time"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "timestamp"
end
end