data_miner 0.4.33 → 0.4.34
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/data_miner.gemspec +1 -1
- data/lib/data_miner/configuration.rb +3 -3
- data/test/data_miner_test.rb +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.34
|
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.4.
|
8
|
+
s.version = "0.4.34"
|
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"]
|
@@ -128,7 +128,7 @@ You need to supply one of #{COMPLETE_UNIT_DEFINITIONS.map(&:inspect).to_sentence
|
|
128
128
|
|
129
129
|
import_steps.each do |step|
|
130
130
|
step.attributes.each do |_, attribute|
|
131
|
-
DataMiner.log_or_raise "You can't have an attribute column that ends in _units (reserved): #{resource.table_name}.#{attribute.name}" if attribute.name.
|
131
|
+
DataMiner.log_or_raise "You can't have an attribute column that ends in _units (reserved): #{resource.table_name}.#{attribute.name}" if attribute.name.end_with? '_units'
|
132
132
|
unless resource.column_names.include? attribute.name
|
133
133
|
missing_columns << attribute.name
|
134
134
|
end
|
@@ -153,7 +153,7 @@ and **replace** the resulting file with this:
|
|
153
153
|
|
154
154
|
class AddMissingColumnsTo#{resource.name} < ActiveRecord::Migration
|
155
155
|
def self.up
|
156
|
-
#{missing_columns.map { |column_name| " add_column :#{resource.table_name}, :#{column_name}, :#{column_name.
|
156
|
+
#{missing_columns.map { |column_name| " add_column :#{resource.table_name}, :#{column_name}, :#{column_name.end_with?('_units') ? 'string' : 'FIXME_WHAT_COLUMN_TYPE_AM_I' }" }.join("\n") }
|
157
157
|
#{non_essential_missing_columns.map { |column_name| " add_column :#{resource.table_name}, :#{column_name}, :integer #optional" }.join("\n") }
|
158
158
|
end
|
159
159
|
|
@@ -165,7 +165,7 @@ and **replace** the resulting file with this:
|
|
165
165
|
|
166
166
|
On the other hand, if you're working directly with create_table, this might be helpful:
|
167
167
|
|
168
|
-
#{missing_columns.map { |column_name| "t.#{column_name.
|
168
|
+
#{missing_columns.map { |column_name| "t.#{column_name.end_with?('_units') ? 'string' : 'FIXME_WHAT_COLUMN_TYPE_AM_I' } '#{column_name}'" }.join("\n") }
|
169
169
|
#{non_essential_missing_columns.map { |column_name| "t.integer '#{column_name}' #optional" }.join("\n") }
|
170
170
|
|
171
171
|
================================
|
data/test/data_miner_test.rb
CHANGED
@@ -1354,7 +1354,7 @@ class DataMinerTest < Test::Unit::TestCase
|
|
1354
1354
|
|
1355
1355
|
should "mine residence survey responses" do
|
1356
1356
|
ResidentialEnergyConsumptionSurveyResponse.run_data_miner!
|
1357
|
-
assert ResidentialEnergyConsumptionSurveyResponse.find(6).residence_class.
|
1357
|
+
assert ResidentialEnergyConsumptionSurveyResponse.find(6).residence_class.start_with?('Single-family detached house')
|
1358
1358
|
end
|
1359
1359
|
end
|
1360
1360
|
end
|