Reset memoized hash keys when new ActionView::Template handler is registered #5101

merged 1 commit into from Feb 20, 2012


None yet

2 participants


When any code in an initializer or gem load accesses the list of view handlers (ActionView::Template::Handlers.extensions), this gets memoized which prevents new handlers (in my case, adding in Mustache via an initializer using ActionView::Template.register_template_handler) from being made available for use.

This patch resets the memoization so that the next time '.extensions' is called, it includes all extensions that have been registered.

@josevalim josevalim merged commit 8c870f1 into rails:3-2-stable Feb 20, 2012
@delynn delynn added a commit to delynn/rails that referenced this pull request Feb 20, 2012
@delynn delynn Merge branch 'master' into prepend-content-for
* master: (45 commits)
  use Hash#delete with a default block
  refactor options_for_select
  refactor grouped_options_for_select
  Fix a failing test
  Use the right format when a partial is missing.
  Merge pull request #5101 from ckdake/ckdake_actionview_handler_reset
  search private / protected methods in trunk ruby
  removed commented line. 3434 tests, 10531 assertions, 0 failures, 0 errors, 31 skips
  Restored ability to identify ID and Sequence from tables relying on a nonmatching sequence default value for PK.
  AM::Errors: allow :full_messages parameter for #as_json
  Remove fixture files with Windows incompatible filenames
  Integration tests support the OPTIONS http method
  Update activerecord/
  fix some typos [ci skip]
  Documenting the :inverse_of option for associations
  add selected and disabled option to grouped select
  assigns(:foo) should not convert @foo's keys to strings if it happens to be a hash
  Fix actionpack readme weblog example
  Fix AbstractController::Base#hidden_actions comment
  Do get it right this time. Fixing the documentation around :dependent => :restrict option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment