data_sanity 0.0.9 → 0.1.0

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.
@@ -35,7 +35,7 @@ module DataSanity
35
35
  def validate_random(model)
36
36
  no_of_records = model.count
37
37
  return if no_of_records == 0
38
- @records_per_model.times do
38
+ @records_per_model.to_i.times do
39
39
  instance = model.offset(rand(no_of_records)).first
40
40
  populate_if_invalid_record(instance, model)
41
41
  end
@@ -64,9 +64,9 @@ module DataSanity
64
64
 
65
65
  def load_models
66
66
  Dir["#{Rails.root}/app/models/**/*.rb"].each { |file_path| require file_path rescue nil }
67
- all_models = ActiveRecord::Base.descendants.select(&:descends_from_active_record?)
68
- all_models.delete(DataInspector)
69
- all_models.collect(&:name)
67
+ all_models = ActiveRecord::Base.descendants.select(&:descends_from_active_record?).collect(&:name)
68
+ all_models.delete("DataInspector")
69
+ all_models
70
70
  end
71
71
 
72
72
  end
@@ -23,7 +23,7 @@ namespace :data_sanity do
23
23
  end
24
24
 
25
25
  desc 'Data Sanity run investigation'
26
- task :investigate, :validate, :records_per_model do |t, args|
26
+ task :investigate, [:validate, :records_per_model] => :environment do |t, args|
27
27
  DataSanity::Inspector.new(args).investigate
28
28
  end
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module DataSanity
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
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: 13
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
+ - 1
8
9
  - 0
9
- - 9
10
- version: 0.0.9
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Habibullah, Rahul, Jigyasa, Jyotsna, Hephzibah, Garima