rails/jbuilder — pull request #232 by vincentwoo (2014-12-15 19:05:28+00:00)
Title: Ensure dependency tracker loads after template handler

As of this commit: https://github.com/rails/jbuilder/commit/c8acc5cea6da2a79b7b345adc301cb5ff2517647, Jbuilder has been requiring the dependency tracking module BEFORE registering the template handler for the `:jbuilder` extension.

Rails tries to associate handlers with dependency trackers, which fails if jbuilder is not registered to handle jbuilder files:

``` ruby
def self.register_tracker(extension, tracker)
handler = Template.handler_for_extension(extension)
@trackers[handler] = tracker
end
```

At this moment in time `handler_for_extension(:jbuilder)` resolves to the default handler, ERBHandler. This causes Rails to set the default tracker for "ERBHandler" to Jbuilder's dependency tracker. This is *very bad* because not only does it not work for digesting jbuilder dependencies, it also breaks digesting for normal erb views too.

I recommend an urgent merge and release.