Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why was auto_link deprecated in Rails?

I realize it's been pulled into a separate gem, but what's the reason? Is this just a matter of streamlining Rails, or is there some reason I should be weary of auto_link?

(The gem says it's meant to 'bridge the gap for people migrating', which suggests to me that if I'm introducing rails_autolink into a new project, I must be doing something wrong, no?)

thanks,

like image 327
doublea Avatar asked Mar 16 '12 05:03

doublea


People also ask

Why is my Rails gem not working?

That usually happens when the gem has rails as a dependency and uses deprecated code in it. If that’s the case you should consider upgrading that gem. Once the changes are done, run the appropriate specs or manually test the parts that were modified to make sure that everything works normally.

How do I find deprecation warnings in rails?

In Rails, all deprecation warnings start with DEPRECATION WARNING:, so you can search for that string in your logs. When it comes to production, the easiest way to discover deprecation warnings is by using a monitoring tool (like Honeybadger or Airbrake ).

Should I upgrade or downgrade a deprecated gem in rails?

Keep in mind that sometimes deprecation warnings can also happen inside gems. That usually happens when the gem has rails as a dependency and uses deprecated code in it. If that’s the case you should consider upgrading that gem.

What is the purpose of deprecated features?

Features are deprecated rather than immediately removed, in order to provide backward compatibility (a solution that works in both the current and the future version), and to give programmers time to implement the code in a way that follows the new standard.


1 Answers

From the commit where auto_link was removed, Aaron Patterson (tenderlove) explains in the comments:

Unfortunately this method is extremely difficult to secure correctly. Ensuring this method is bullet-proof takes a faster release cycle than we have for rails. That's why we moved it to a gem. Please use the gem if you need the functionality! :-)

https://github.com/rails/rails/commit/81cfbf4146d3c5a58054b64112b8ce196f2fc061

Each security fix only requires updating one gem, instead of the 6 for rails.

like image 197
Shawn Balestracci Avatar answered Jan 02 '23 05:01

Shawn Balestracci