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

[#516] Fix error cannot run command rails generate administrate:install #517

Conversation

nguyen7thai
Copy link

@@ -7,6 +7,8 @@ def initialize(namespace)
def resources
namespace_controller_paths.uniq.map do |controller|
controller.gsub(/^#{namespace}\//, "").to_sym

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this second validation to this line might be a better idea in my opinion:

controller.starts_with?(namespace.to_s) && !controller.end_with?('/')

It removes the complexity of having to run throughout the collection twice, also it won't allow any possible sub-route root to mess the generation up

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, but in that case, the block would return a nil value (we are using method map here) and we have to remove the nil value in the collection thereafter?

@nickcharlton
Copy link
Member

Hi! Thanks for this PR. I'd not actually seen this when I went ahead and did #713, which purports to fix the referenced issue. I'm going to close this for now, but feel free to reopen if it doesn't.

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.

3 participants