Project

General

Profile

Bug #13878

assets_paths initializer fails calling generate_railtie_name on Rails 4.2

Added by Dominic Cleal about 6 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

On Rails 4.2, a railtie is getting added that has no name. This causes our initialiser that checks for deprecated engine initialisers to fail on Rails startup with the following error:

/home/dcleal/.rvm/gems/ruby-2.0.0-p353@foreman/gems/railties-4.2.5.1/lib/rails/railtie.rb:187:in `generate_railtie_name': undefined method `tr' for nil:NilClass (NoMethodError)
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p353@foreman/gems/railties-4.2.5.1/lib/rails/railtie.rb:165:in `railtie_name'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p353@foreman/gems/railties-4.2.5.1/lib/rails/railtie.rb:201:in `railtie_name'
        from /home/dcleal/code/foreman/foreman/config/initializers/assets_paths.rb:9:in `block in <top (required)>'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p353@foreman/gems/railties-4.2.5.1/lib/rails/engine/railties.rb:13:in `each'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p353@foreman/gems/railties-4.2.5.1/lib/rails/engine/railties.rb:13:in `each'
        from /home/dcleal/code/foreman/foreman/config/initializers/assets_paths.rb:9:in `select'
        from /home/dcleal/code/foreman/foreman/config/initializers/assets_paths.rb:9:in `<top (required)>'

Debug shows:

> Rails.application.railties.find { |e| e.class.name.nil? }.inspect
#<#<Class:0x00000002f84f88>:0x00000005c678e8 @initializers=[]>

Handling of this can be backported safely to develop.


Related issues

Blocks Foreman - Feature #13244: Upgrade Ruby on Rails to 4.2Closed2016-01-15

Associated revisions

Revision 554107ca (diff)
Added by Dominic Cleal about 6 years ago

fixes #13878 - handle anonymous railtie classes seen on Rails 4.2

History

#1 Updated by Dominic Cleal about 6 years ago

#2 Updated by The Foreman Bot about 6 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3231 added

#3 Updated by Dominic Cleal about 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal about 6 years ago

  • Legacy Backlogs Release (now unused) set to 136

Also available in: Atom PDF