-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
destroy administrate:views not working #310
Milestone
Comments
@masciugo interesting. I haven't used the |
ya. It magically works for the other adminstrate generators |
c-lliope
added a commit
that referenced
this issue
Jan 20, 2016
Fixes #310 Problem: Rails provides a way to undo the effects of generators, by running the command `rails destroy GENERATOR_NAME`. With the way that we had set up our hierarchy of generators, Rails did not know how to undo the effects of sub-generators. For example, with the `administrate:views` generator, we were calling `Rails::Generators.invoke("administrate:views:index")`. Whether the generator was run with the `generate` or `destroy` command did not make a difference - the index generator would always be invoked as if it were run with `generate`. Solution: Rails generators use the `@behavior` instance variable to keep track of how the generator was run. This variable can be either `:invoke` or `:revoke`. Pass this variable as an option to the sub-generators to ensure they have the same behavior as the parent.
c-lliope
added a commit
that referenced
this issue
Jan 20, 2016
Fixes #310 Problem: Rails provides a way to undo the effects of generators, by running the command `rails destroy GENERATOR_NAME`. With the way that we had set up our hierarchy of generators, Rails did not know how to undo the effects of sub-generators. For example, with the `administrate:views` generator, we were calling `Rails::Generators.invoke("administrate:views:index")`. Whether the generator was run with the `generate` or `destroy` command did not make a difference - the index generator would always be invoked as if it were run with `generate`. Solution: Rails generators use the `@behavior` instance variable to keep track of how the generator was run. This variable can be either `:invoke` or `:revoke`. Pass this variable as an option to the sub-generators to ensure they have the same behavior as the parent. Minor changes: Extract `Administrate::GeneratorHelpers` to store common generator-related methods.
c-lliope
added a commit
that referenced
this issue
Jan 20, 2016
Fixes #310 Problem: Rails provides a way to undo the effects of generators, by running the command `rails destroy GENERATOR_NAME`. With the way that we had set up our hierarchy of generators, Rails did not know how to undo the effects of sub-generators. For example, with the `administrate:views` generator, we were calling `Rails::Generators.invoke("administrate:views:index")`. Whether the generator was run with the `generate` or `destroy` command did not make a difference - the index generator would always be invoked as if it were run with `generate`. Solution: Rails generators use the `@behavior` instance variable to keep track of how the generator was run. This variable can be either `:invoke` or `:revoke`. Pass this variable as an option to the sub-generators to ensure they have the same behavior as the parent. Minor changes: Extract `Administrate::GeneratorHelpers` to store common generator-related methods.
c-lliope
added a commit
that referenced
this issue
Jan 22, 2016
Fixes #310 Problem: Rails provides a way to undo the effects of generators, by running the command `rails destroy GENERATOR_NAME`. With the way that we had set up our hierarchy of generators, Rails did not know how to undo the effects of sub-generators. For example, with the `administrate:views` generator, we were calling `Rails::Generators.invoke("administrate:views:index")`. Whether the generator was run with the `generate` or `destroy` command did not make a difference - the index generator would always be invoked as if it were run with `generate`. Solution: Rails generators use the `@behavior` instance variable to keep track of how the generator was run. This variable can be either `:invoke` or `:revoke`. Pass this variable as an option to the sub-generators to ensure they have the same behavior as the parent. Minor changes: Extract `Administrate::GeneratorHelpers` to store common generator-related methods.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it seems that
generate
anddestroy
do the same thing:The text was updated successfully, but these errors were encountered: