lib/sniff/fixture.rb in sniff-0.11.2 vs lib/sniff/fixture.rb in sniff-0.11.3
- old
+ new
@@ -2,9 +2,11 @@
module Sniff
module Fixture
extend self
+ # FIXME TODO this doesn't work for models where the model name is different from the table name
+ # (e.g. PetroleumAdministrationForDefenseDistrict, ResidentialEnergyConsumptionSurveyResponse)
def load_fixtures(fixtures_path)
Encoding.default_external = 'UTF-8' if Object.const_defined?('Encoding')
Dir.glob(File.join(fixtures_path, '**/*.csv')) do |fixture_file|
table_name = File.basename(fixture_file, '.csv')
model_name = table_name.singularize.camelize