pinnymz / migration_comments

Comments for your migrations
MIT License
173 stars 31 forks source link

Remove config/database.yml dependency in MysqlAdapter #8

Closed edennis closed 11 years ago

edennis commented 11 years ago

My reasons for this change are two-fold:

  1. My current project makes use of ERB in config/database.yml which isn't supported by the gem. If you take a look in the railties gem you'll see that this is supported:

https://github.com/rails/rails/blob/master/railties/lib/rails/application/configuration.rb#L105

  1. Since it's conceivable to want to use your gem with only ActiveRecord outside of a Rails environment I wanted to get rid of the dependency to Rails.env in line 101 of the diff.

Selecting the current database from mysql and storing it in an instance variable gets rid of this dependency.

The tests are running (at least in the same state as they were before with the last two failing b/c of the rails 4 migration). I'd be happy to get your feedback on this. :)

pinnymz commented 11 years ago

The fix for dynamic config template looks good - thanks for the patch! I've been wanting to limit the dependency to ActiveRecord for some time. This is now done as well in commit 1bcd8ee5dc44a1b61f580a228791e20465636081, thanks to you.