pascalh1011/migrant — Issue #18: Auto-ignore models without structure block
Author: KieranP
Created: 2012-03-06 21:43:24+00:00
State: open

I have `acts-as-taggable-on` plugin installed. When I run `rake generate migrations` it's prompting me to delete the context and created_at columns. It's also generating all sorts of migrations to affect indexes, which I don't want.

The reason I believe is because they have a `belongs_to` call, which is initializing the schema. The thing is though, the taggable model doesn't initialize any other schema via the structure block. So either you only acts on models in app/models (which will mean gems won't be able to utilize migrant), or the better solution:

Ignore models unless structure block was specifically called.

```
def structure(type=nil, &block)
@initialized ||= true
...
end

def generate_migrations
models.select(&:initialized?).each { ... }
end
```