Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-3851

The app_name function in config geneartion fails if there are no Rails::...

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0
    • Affects Version/s: None
    • Component/s: None
    • None

      ...Application subclasses as might be the case with engines. Without this you'll get an error like this:

      rails g mongoid:config
      /Users/timo/.rvm/gems/ruby-2.1.4@nappi_frontend/gems/mongoid-4.0.0/lib/rails/generators/mongoid/config/config_generator.rb:18:in `app_name': undefined method `parent' for nil:NilClass (NoMethodError)
      	from /Users/timo/.rvm/gems/ruby-2.1.4@nappi_frontend/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
      	from /Users/timo/.rvm/gems/ruby-2.1.4@nappi_frontend/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
      	from /Users/timo/.rvm/gems/ruby-2.1.4@nappi_frontend/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
      	from /Users/timo/.rvm/gems/ruby-2.1.4@nappi_frontend/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
      	from /Users/timo/.rvm/gems/ruby-2.1.4@nappi_frontend/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
      	from /Users/timo/.rvm/gems/ruby-2.1.4@nappi_frontend/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
      	from /Users/timo/.rvm/gems/ruby-2.1.4@nappi_frontend/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
      	from /Users/timo/.rvm/gems/ruby-2.1.4@nappi_frontend/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
      	from /Users/timo/.rvm/gems/ruby-2.1.4@nappi_frontend/gems/railties-4.1.7/lib/rails/generators.rb:157:in `invoke'
      	from /Users/timo/.rvm/gems/ruby-2.1.4@nappi_frontend/gems/railties-4.1.7/lib/rails/commands/generate.rb:11:in `<top (required)>'
      	from /Users/timo/.rvm/gems/ruby-2.1.4@nappi_frontend/gems/railties-4.1.7/lib/rails/engine/commands.rb:19:in `require'
      	from /Users/timo/.rvm/gems/ruby-2.1.4@nappi_frontend/gems/railties-4.1.7/lib/rails/engine/commands.rb:19:in `<top (required)>'
      	from bin/rails:12:in `require'
      	from bin/rails:12:in `<main>'
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            timolehto timolehto
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: