Permalink
Browse files

admin gives more data

  • Loading branch information...
drhenner committed Jul 24, 2012
1 parent e4723b4 commit 3b57c14ddbbff310264cb99d08fc5353057a97d6
@@ -1,5 +1,5 @@
class ValidationIssue < ActiveRecord::Base
- attr_accessible :form_name, :issue_count, :issue_hash, :issue_type, :notes
+ attr_accessible :form_name, :issue_count, :issue_hash, :issue_type, :notes, :success_count
serialize :issue_hash, Hash
validates :form_name, :presence => true, :uniqueness => true
@@ -19,6 +19,10 @@ def increment_success_count!
increment_with_sql!('success_count')
end
+ def total_count
+ success_count + issue_count
+ end
+
protected
def increment_with_sql!(attribute, by = 1)
@@ -6,7 +6,8 @@
<tr>
<th>Type</th>
<th>Form Name</th>
- <th>Count</th>
+ <th># of Issues</th>
+ <th>Total Count</th>
<th></th>
<th></th>
</tr>
@@ -16,6 +17,7 @@
<td><%= validation_issue.issue_type %></td>
<td><%= validation_issue.form_name %></td>
<td><%= validation_issue.issue_count %></td>
+ <td><%= validation_issue.total_count %></td>
<td><%= link_to 'Show', validation_admin_validation_issue_path(validation_issue) %></td>
<td><%= link_to 'Reset!',
validation_admin_validation_issue_path(validation_issue),
@@ -5,8 +5,8 @@ def change
t.string :form_name, :null => false
t.text :issue_hash, :null => false
t.text :notes, :default => ''
- t.integer :issue_count
- t.integer :success_count
+ t.integer :issue_count, :default => 0
+ t.integer :success_count, :default => 0
t.timestamps
end

0 comments on commit 3b57c14

Please sign in to comment.