validb 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40a83f3927b8d9661c1b0874559a05dfdeaf78f0
4
- data.tar.gz: 4df6d994ea80e72f779ce9d7ec484e2071947d0f
3
+ metadata.gz: 6cf59a57d2e7a7218ba7e757ff4f749d6580582d
4
+ data.tar.gz: 84a2ece5b8606e99232db4441be80cab9ad50cd6
5
5
  SHA512:
6
- metadata.gz: 3196d9fbef183fbc8ade302614532250b907e5a70d4e12bcd533ec69be7093f28ff55c818ad9a5561accdd14544bfa4b14c1147ceab4d50e80e65436b8dff049
7
- data.tar.gz: 6837377429c74bc01244cbd61a9fc05d6d60f82976a410e9c17e72def57bc7263d4e49e7b4e6ca4a1f1ba9122f1f7f5579af3379edab8d8aed9f79c993cafd9a
6
+ metadata.gz: f0bacdfd14f9864abb0fae1a8031041c3ca77ba214381a0d2febed0cfda3d6ff297f2bcde18f1c49475c5d3ce0d09c9d4a0a152e790e451ee9c6ca0d3ae5bb22
7
+ data.tar.gz: 43f299bccc537dca44c532eeaaee011c88ada7b328186b6bf94e2629ac9b996749b8153b55651430ec285939747e5fed6936a8aa6101fe2e068835193a1c44f9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.0.3, released 2013-03-25
2
+ * Use table_exists? in place of table name
3
+ * Add progress indicator during run
4
+
1
5
  ## 0.0.2, released 2013-03-25
2
6
  * Change to dependency on rails
3
7
 
data/lib/validb/finder.rb CHANGED
@@ -9,7 +9,7 @@ module Validb
9
9
  private
10
10
 
11
11
  def all
12
- @models ||= ActiveRecord::Base.descendants.select { |model| model.table_name }
12
+ @models ||= ActiveRecord::Base.descendants.select { |model| model.table_exists? }
13
13
  end
14
14
 
15
15
  def filter_models(model_names)
@@ -12,6 +12,7 @@ module Validb
12
12
  private
13
13
 
14
14
  def validate_batch(record_batch)
15
+ puts "."
15
16
  record_batch.each do |record|
16
17
  RecordValidator.validate(record)
17
18
  end
@@ -2,7 +2,7 @@ module Validb
2
2
  class RecordValidator
3
3
  def self.validate(record)
4
4
  if !record.valid?
5
- puts "#{record.id} - #{record.errors.full_messages.join(',')}"
5
+ puts "#{record.class.name}:#{record.id} - #{record.errors.full_messages.join(',')}"
6
6
  end
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module Validb
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -1,6 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Validb::Finder do
4
+ class NoTable < ActiveRecord::Base
5
+ end
6
+
4
7
  describe ".get_models" do
5
8
  context "with an empty string" do
6
9
  Validb::Finder.get_models("").should =~ [Post, Blog, Comment]
@@ -5,6 +5,7 @@ describe Validb::ModelValidator do
5
5
  context "with a model" do
6
6
  it "validates the records of the model" do
7
7
  model = Blog
8
+
8
9
  $stdout.should_receive(:puts).with("Checking Blog")
9
10
 
10
11
  Validb::ModelValidator.validate(model)
@@ -17,7 +17,7 @@ describe Validb::RecordValidator do
17
17
  record = Blog.new
18
18
  record.save(validate: false)
19
19
 
20
- $stdout.should_receive(:puts).with("#{record.id} - Title can't be blank")
20
+ $stdout.should_receive(:puts).with("Blog:#{record.id} - Title can't be blank")
21
21
 
22
22
  Validb::RecordValidator.validate(record)
23
23
  end
@@ -2,6 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  describe Validb do
4
4
  it "returns the version" do
5
- Validb::VERSION.should == "0.0.2"
5
+ Validb::VERSION.should == "0.0.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joey Geiger