data_miner 0.3.9 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.9
1
+ 0.3.10
data/data_miner.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{data_miner}
8
- s.version = "0.3.9"
8
+ s.version = "0.3.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Seamus Abshere", "Andy Rossmeissl"]
data/lib/data_miner.rb CHANGED
@@ -59,7 +59,12 @@ ActiveRecord::Base.class_eval do
59
59
  belongs_to :data_miner_last_run, :class_name => 'DataMiner::Run'
60
60
 
61
61
  # this is class_eval'ed here so that each ActiveRecord descendant has its own copy, or none at all
62
- class_eval { cattr_accessor :data_miner_config }
62
+ class_eval do
63
+ cattr_accessor :data_miner_config
64
+ def self.data_miner_runs
65
+ DataMiner::Run.scoped :conditions => { :resource_name => name }
66
+ end
67
+ end
63
68
  self.data_miner_config = DataMiner::Configuration.new self
64
69
 
65
70
  Blockenspiel.invoke block, data_miner_config
@@ -916,6 +916,12 @@ class DataMinerTest < Test::Unit::TestCase
916
916
  assert_equal Country.first.data_miner_last_run.resource_records_last_touched_by_me.count, Country.count
917
917
  end
918
918
 
919
+ should "know what runs were on a resource" do
920
+ DataMiner.run :resource_names => %w{ Country }
921
+ DataMiner.run :resource_names => %w{ Country }
922
+ assert Country.data_miner_runs.count > 0
923
+ end
924
+
919
925
  unless ENV['FAST'] == 'true'
920
926
  should "import using a dictionary" do
921
927
  DataMiner.run :resource_names => %w{ ResidentialEnergyConsumptionSurveyResponse }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_miner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seamus Abshere