Skip to content

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

Merged
senny merged 1 commit into
rails:masterfrom
senny:extract_next_migration_number_into_module
Sep 30, 2013
Merged

Extract .next_migration_number into module for third party generators.#12407
senny merged 1 commit into
rails:masterfrom
senny:extract_next_migration_number_into_module

Conversation

@senny

@senny senny commented Sep 30, 2013

Copy link
Copy Markdown
Member

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

senny commented Sep 30, 2013

Copy link
Copy Markdown
Member Author

@rafaelfranca @carlosantoniodasilva can you take a look?

@rafaelfranca

Copy link
Copy Markdown
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

senny commented Sep 30, 2013

Copy link
Copy Markdown
Member Author

@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.

2 participants