mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
021f3d24f3
Assuming the type ":touch", Collector.new was calling send(:touch), which instead of triggering method_missing and generating a new collector method, actually invoked the private method `touch` inherited from Object. By generating the method for each mime type as it is registered, the private methods on Object can never be reached by `send`, because the `Collector` will have them before `send` is called on it. To do this, a callback mechanism was added to Mime::Type This allows someone to add a callback for whenever a new mime type is registered. The callback then gets called with the new mime as a parameter. This is then used in AbstractController::Collector to generate new collector methods after each mime is registered. |
||
---|---|---|
.. | ||
railties | ||
asset_paths.rb | ||
base.rb | ||
callbacks.rb | ||
collector.rb | ||
helpers.rb | ||
layouts.rb | ||
logger.rb | ||
rendering.rb | ||
translation.rb | ||
url_for.rb | ||
view_paths.rb |