Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Rails 3 removing Metal?

Is Rails 3 removing Metal?

I am trying to implement Mongoid, Carrierwave and grid_fs.

I have followed guide 1.

However, I have read that Rails 3 is removing Metal ( http://github.com/rails/rails/commit/ed34652d1aca148fea61c5309c1bd5ff3a55abfa ).

So I stumbled across this article instead: guide 2

Given the circumstances that Rails 3 may be removing Metal and for future maintenance. Which guide is more suitable to get grid_fs, Mongoid and Carrierwave all working together?

like image 904
Christian Fazzini Avatar asked Dec 03 '10 01:12

Christian Fazzini


1 Answers

You noticed a commit with the comment "Removing Metal from Rails 3." However, what is going on is actually quite the opposite of that phrase!

Rails 3 did not remove metal. Quite the opposite. Now, all controllers are metals, with only those additional features that you request. All you need to do is inherit your particular controller class from ActionController::Metal, and then include any particular modules that provide the additional features you want in that particular controller.

Of course, most people will inherit their controllers from ActionController::Base. But now, ActionController::Base merely inherits ActionController::Metal and includes all of the additional feature modules.

That commit you noticed is removing metals as a separate feature, apart from the rest of ActionPack. Now, metals are no longer a separate feature, so the separate feature implementation of metals was removed. Now, everything is a metal.

like image 111
yfeldblum Avatar answered Nov 14 '22 09:11

yfeldblum