aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/assertions
diff options
context:
space:
mode:
authorMircea Pricop <mircea.a.pricop@gmail.com>2012-07-06 17:19:20 +0200
committermircea <mircea@mircea-X58L.(none)>2012-07-06 20:38:23 +0200
commit021f3d24f32dbad98c72cd5c36ff0b511be07a64 (patch)
treea68022e52b587335735c3625830befc2d2216330 /actionpack/test/assertions
parent07314e64fd62fb8e6165c8c539420160da9437e9 (diff)
downloadrails-021f3d24f32dbad98c72cd5c36ff0b511be07a64.tar.gz
rails-021f3d24f32dbad98c72cd5c36ff0b511be07a64.tar.bz2
rails-021f3d24f32dbad98c72cd5c36ff0b511be07a64.zip
Prevent conflict between mime types and Object methods
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.
Diffstat (limited to 'actionpack/test/assertions')
0 files changed, 0 insertions, 0 deletions