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

Projects
None yet
2 participants
@senny
Member

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

This comment has been minimized.

Show comment
Hide comment
@senny
Member

senny commented Sep 30, 2013

@rafaelfranca @carlosantoniodasilva can you take a look?

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca
Member

rafaelfranca commented Sep 30, 2013

:shipit:

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

Merge pull request #12407 from senny/extract_next_migration_number_in…
…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 senny:extract_next_migration_number_into_module branch Sep 30, 2013

@senny

This comment has been minimized.

Show comment
Hide comment
@senny

senny Sep 30, 2013

Member

@rafaelfranca thank you ❤️

Member

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