Skip to content

Commit

Permalink
[#915] ignore generated :polymorphic klass shims in migration generator
Browse files Browse the repository at this point in the history
  • Loading branch information
al2o3cr committed Sep 25, 2011
1 parent 17011ac commit 3ef3252
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -9,7 +9,7 @@ def klass_with_create_polymorphic_class
begin
klass_without_create_polymorphic_class
rescue NameError => e
Object.class_eval "class #{e.missing_name} < ActiveRecord::Base; set_table_name '#{active_record.name.tableize}'; end"
Object.class_eval "class #{e.missing_name} < ActiveRecord::Base; set_table_name '#{active_record.name.tableize}'; def self.hobo_shim?; true; end; end"
e.missing_name.constantize
end
else
Expand Down
2 changes: 1 addition & 1 deletion hobo_fields/lib/generators/hobo/migration/migrator.rb
Expand Up @@ -130,7 +130,7 @@ def models_and_tables
all_models = table_model_classes
hobo_models = all_models.select { |m| m.try.include_in_migration && m.name.underscore.not_in?(ignore_model_names) }
non_hobo_models = all_models - hobo_models
db_tables = connection.tables - Migrator.ignore_tables.*.to_s - non_hobo_models.*.table_name
db_tables = connection.tables - Migrator.ignore_tables.*.to_s - non_hobo_models.reject { |t| t.try.hobo_shim? }.*.table_name
[hobo_models, db_tables]
end

Expand Down

0 comments on commit 3ef3252

Please sign in to comment.