Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #19 from okcwest/master

Handle edge case where table name matches a global module name
  • Loading branch information...
commit 3cb14d5acad9b259c8f75bbb65116d290d4490cd 2 parents 2d56723 + 8b3d837
@rdy authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/fixture_builder/builder.rb
View
4 lib/fixture_builder/builder.rb
@@ -88,7 +88,7 @@ def dump_tables
begin
fixtures = tables.inject([]) do |files, table_name|
table_klass = table_name.classify.constantize rescue nil
- if table_klass
+ if table_klass && table_klass < ActiveRecord::Base
rows = table_klass.unscoped { table_klass.all.collect(&:attributes) }
else
rows = ActiveRecord::Base.connection.select_all(select_sql % ActiveRecord::Base.connection.quote_table_name(table_name))
@@ -120,4 +120,4 @@ def fixture_file(table_name)
fixtures_dir("#{table_name}.yml")
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.