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

BUG v1.4.0 Generators do not work in Rails engine #226

Closed
Epigene opened this issue Dec 6, 2017 · 2 comments
Closed

BUG v1.4.0 Generators do not work in Rails engine #226

Epigene opened this issue Dec 6, 2017 · 2 comments

Comments

@Epigene
Copy link

Epigene commented Dec 6, 2017

Hi!

I am trying to run the scenic generators in a Rails engine, but am getting an error.

Running rails g scenic:view test_report produces

/Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/scenic-1.4.0/lib/generators/scenic/view/view_generator.rb:77:in `views_directory_path': undefined method `join' for nil:NilClass (NoMethodError)
	from /Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/scenic-1.4.0/lib/generators/scenic/view/view_generator.rb:14:in `create_views_directory'
	from /Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
	from /Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
	from /Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `block in invoke_all'
	from /Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `each'
	from /Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `map'
	from /Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `invoke_all'
	from /Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/thor-0.20.0/lib/thor/group.rb:232:in `dispatch'
	from /Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
	from /Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/railties-4.1.16/lib/rails/generators.rb:157:in `invoke'
	from /Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/railties-4.1.16/lib/rails/commands/generate.rb:11:in `<top (required)>'
	from /Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/railties-4.1.16/lib/rails/engine/commands.rb:19:in `require'
	from /Users/developer/.rvm/gems/ruby-2.1.2@cs/gems/railties-4.1.16/lib/rails/engine/commands.rb:19:in `<top (required)>'
	from bin/rails:12:in `require'
	from bin/rails:12:in `<main>'
@derekprior
Copy link
Contributor

I'm not certain what we can do about this one. It seems the way we're supposed to get the engine root is via EngineName::EngineClass.root but we don't know either of those. This isn't a feature I've ever wanted, so I'm not likely to spend much time chasing it down. @Epigene Is this something you'd be willing to spend some time on?

@Epigene
Copy link
Author

Epigene commented Dec 16, 2017

Nay, there is the additional problem of having to copy the view SQL files from engine to main app alongside engine migration files. I ended up writing a vanilla materialized view migration in engine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants