validation_issues 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e1057cc73973c01029a6bda7f6ba87e3c529071
|
4
|
+
data.tar.gz: be8f1fba4ebb707659744f125f84322f48d89128
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8420abfdbf2341650fb17543588e61e8ba1fdd1af5e2702a33fc49ae974e1a62ad02fc8e6bf3f2eb03e3721941e7fa2b4bc483fd0ee631f47345cfb406f7010a
|
7
|
+
data.tar.gz: 9d507151cd8c2560ca76fe7b126b93ed72797fac69783690c61e2db682827827c4f50fc2b62dca99b6e629509c067a76ee11968119b37c7546852927c0e04066
|
@@ -1,14 +1,13 @@
|
|
1
1
|
class ValidationIssue < ActiveRecord::Base
|
2
|
-
attr_accessible :form_name, :issue_count, :issue_hash, :issue_type, :notes, :success_count
|
3
2
|
serialize :issue_hash, Hash
|
4
3
|
|
5
|
-
validates :form_name, :
|
4
|
+
validates :form_name, presence: true, uniqueness: true
|
6
5
|
|
7
6
|
def clear_data!
|
8
7
|
self.issue_count = 0
|
9
8
|
self.success_count = 0
|
10
|
-
self.issue_hash
|
11
|
-
self.notes
|
9
|
+
self.issue_hash = {}
|
10
|
+
self.notes = ''
|
12
11
|
self.save!
|
13
12
|
end
|
14
13
|
|
@@ -15,7 +15,7 @@ module ValidationIssues
|
|
15
15
|
def log_validation_issue!(form_name, options = {})
|
16
16
|
if self.errors
|
17
17
|
vi = ValidationIssue.find_by_form_name_and_issue_type(form_name, self.class.to_s)
|
18
|
-
vi ||= ValidationIssue.new(:
|
18
|
+
vi ||= ValidationIssue.new( form_name: form_name, issue_type: self.class.to_s)
|
19
19
|
|
20
20
|
self.errors.map {|k,v| k }.uniq.each do |error_field|
|
21
21
|
vi.issue_hash = {} if vi.issue_hash.blank?
|
@@ -35,10 +35,10 @@ module ValidationIssues
|
|
35
35
|
|
36
36
|
def log_successful_validation!(form_name, options = {})
|
37
37
|
vi = ValidationIssue.find_by_form_name_and_issue_type(form_name, self.class.to_s)
|
38
|
-
vi ||= ValidationIssue.new(:
|
38
|
+
vi ||= ValidationIssue.new( form_name: form_name, issue_type: self.class.to_s)
|
39
39
|
vi.notes ||= ''
|
40
40
|
vi.issue_count ||= 0
|
41
|
-
vi.issue_hash ||= {:
|
41
|
+
vi.issue_hash ||= { no_issues: '' }
|
42
42
|
vi.save
|
43
43
|
vi.increment_success_count!
|
44
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validation_issues
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Henner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|