data_sanity 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
  ############################################
@@ -1,3 +1,3 @@
1
1
  module DataSanity
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -201,8 +201,10 @@ describe "DataSanity::Inspector" do
201
201
  end
202
202
 
203
203
  def criteria_multiple
204
- "Car:
205
- Person:"
204
+ "#test:
205
+ Car:
206
+ Person:
207
+ "
206
208
  end
207
209
 
208
210
  end
@@ -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 => 20111205042538) do
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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 6
10
- version: 0.1.6
9
+ - 7
10
+ version: 0.1.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Habibullah, Rahul, Jigyasa, Jyotsna, Hephzibah, Garima