data_sanity 0.1.6 → 0.1.7
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.
@@ -48,6 +48,7 @@ module DataSanity
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def validate_criteria(model, criteria)
|
51
|
+
validate_random(model) and return if criteria.blank?
|
51
52
|
criteria.each do |attribute, values|
|
52
53
|
values = (model.select("DISTINCT(#{attribute})").collect(&attribute.to_sym)) if values.blank?
|
53
54
|
values.each do |value|
|
@@ -4,4 +4,9 @@
|
|
4
4
|
#<Model Name>: # Criteria-Rule to be applied
|
5
5
|
# <field name>: ['Raju', 'kaju', 'Taju'] # Field is considered for validations against distinct values in array
|
6
6
|
# <age>: # Field is considered for validations against all possible distinct values
|
7
|
+
#
|
8
|
+
#Note Leave a blank line if you are just writing model namess
|
9
|
+
#eg
|
10
|
+
#<Model1>:
|
11
|
+
#<Model2>:
|
7
12
|
############################################
|
data/lib/data_sanity/version.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended to check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(:version =>
|
13
|
+
ActiveRecord::Schema.define(:version => 20120413062540) do
|
14
14
|
|
15
15
|
create_table "cars", :force => true do |t|
|
16
16
|
t.string "name"
|
@@ -21,6 +21,15 @@ ActiveRecord::Schema.define(:version => 20111205042538) do
|
|
21
21
|
t.datetime "updated_at"
|
22
22
|
end
|
23
23
|
|
24
|
+
create_table "data_inspectors", :force => true do |t|
|
25
|
+
t.string "table_name"
|
26
|
+
t.string "table_primary_key"
|
27
|
+
t.string "primary_key_value"
|
28
|
+
t.text "validation_errors"
|
29
|
+
t.datetime "created_at"
|
30
|
+
t.datetime "updated_at"
|
31
|
+
end
|
32
|
+
|
24
33
|
create_table "people", :force => true do |t|
|
25
34
|
t.string "name"
|
26
35
|
t.integer "age"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_sanity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 7
|
10
|
+
version: 0.1.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Habibullah, Rahul, Jigyasa, Jyotsna, Hephzibah, Garima
|