1
0

Removed Measurement 'hidden' attribute

This commit is contained in:
cryptogopher 2019-12-27 01:48:22 +01:00
parent 2dcc750355
commit 056d3b150d
3 changed files with 1 additions and 8 deletions

View File

@ -23,7 +23,6 @@ class Measurement < ActiveRecord::Base
after_initialize do after_initialize do
if new_record? if new_record?
self.hidden = false if self.hidden.nil?
self.taken_at = Time.now self.taken_at = Time.now
end end
end end
@ -43,10 +42,6 @@ class Measurement < ActiveRecord::Base
.find_or_create_by(name: self.name, domain: ColumnView.domains[:measurement]) .find_or_create_by(name: self.name, domain: ColumnView.domains[:measurement])
end end
def toggle_hidden!
self.toggle!(:hidden)
end
def taken_at_date def taken_at_date
self.taken_at.getlocal self.taken_at.getlocal
end end

View File

@ -11,8 +11,7 @@
<tbody> <tbody>
<% @measurements.each do |m| %> <% @measurements.each do |m| %>
<% next if m.new_record? %> <% next if m.new_record? %>
<tr id="measurement-<%= m.id %>" <tr id="measurement-<%= m.id %>" class="primary measurement">
class="primary measurement <%= 'hidden' if m.hidden %>">
<td class="date unwrappable"><%= format_datetime(m) %></td> <td class="date unwrappable"><%= format_datetime(m) %></td>
<td class="name"> <td class="name">
<div style="float:left;"> <div style="float:left;">

View File

@ -62,7 +62,6 @@ class CreateSchema < ActiveRecord::Migration
t.references :project t.references :project
t.string :name t.string :name
t.references :source t.references :source
t.boolean :hidden
t.timestamp :taken_at t.timestamp :taken_at
t.timestamps null: false t.timestamps null: false
end end