Skip to content

Handling the unneeded migration filecreation using method_added capture approach #164

New issue

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

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

Already on GitHub? # to your account

Conversation

Navdevl
Copy link
Contributor

@Navdevl Navdevl commented Jun 16, 2021

This fixes #137 (Migration related to comments getting created during rails g active_admin:install)

Considering the Rails::Generators::NamedBase is one of the nearest ancestor to ActiveAdmin::Generators::InstallGenerator, we can open the class and an empty create_migration to the class(which will overridden by other subclasses). We can specifically focus on the ActiveAdmin::Generators::InstallGenerator class and apply remove_method during the method_added call and thereby pushing ActiveAdmin::Generators::InstallGenerator to use our empty create_migrations method.

Verified locally and the specs are passing in local as well.

@boie0025 @grzegorz-jakubiak Please let me know if this changes doesn't a right fit for the facing issue.

Signed-off-by: Naveen Honest Raj K naveendurai19@gmail.com

…re approach

Signed-off-by: Naveen Honest Raj K <naveendurai19@gmail.com>
@grzegorz-jakubiak grzegorz-jakubiak merged commit bbcae43 into activeadmin:master Jul 4, 2021
@Navdevl Navdevl deleted the fix-unneeded-migration-creation branch July 4, 2021 19:17
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

migration created
3 participants