Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract .next_migration_number into module for third party generators. #12407

Merged
merged 1 commit into from Sep 30, 2013

Conversation

senny
Copy link
Member

@senny senny commented Sep 30, 2013

Many third party generators, who need to generate migrations copy the .next_migration_number method. This is necessary because most of the time you can't extend ActiveRecord::Generators::Base because it's superclass is Rails::Generators::NamedBase. Some examples:

This copying has the negative effect that over time every implementation will be slightly different and falls out of sync.

This PR bundles the necessary functionality for Active Record Migration generators inside a new module ActiveRecord::Generators::Migration. This module gets migration_template working without any further configuration.

@senny
Copy link
Member Author

senny commented Sep 30, 2013

@rafaelfranca @carlosantoniodasilva can you take a look?

@rafaelfranca
Copy link
Member

:shipit:

senny added a commit that referenced this pull request Sep 30, 2013
…to_module

Extract `.next_migration_number` into module for third party generators.
@senny senny merged commit 47a19eb into rails:master Sep 30, 2013
@senny senny deleted the extract_next_migration_number_into_module branch September 30, 2013 13:04
@senny
Copy link
Member Author

senny commented Sep 30, 2013

@rafaelfranca thank you ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants