为什么在 Rails 中不推荐使用 auto_link? [英] Why was auto_link deprecated in Rails?

查看:46
本文介绍了为什么在 Rails 中不推荐使用 auto_link?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到它已被拉入一个单独的 gem 中,但原因是什么?这只是简化 Rails 的问题,还是我应该厌倦 auto_link 的原因?

(gem 说它是为了弥合人们迁移的差距",这表明如果我将 rails_autolink 引入一个新项目,我一定是做错了什么,不是吗?)

谢谢,

解决方案

从移除 auto_link 的提交,Aaron Patterson (tenderlove) 在评论中解释:

<块引用>

不幸的是,这种方法极难正确保护.确保这种方法是防弹的,需要比 Rails 更快的发布周期.这就是为什么我们将其移至 gem 的原因.如果您需要该功能,请使用 gem!:-)

https://github.com/rails/rails/commit/81cfbf4146d3c5a58054b64112b8ce196f2fc061">https://github.com/rails/rails/commit/81cfbf4146d3c5a58054b641961bc5a581961bcfb2f88054b

每个安全修复只需要更新一个 gem,而不是 Rails 的 6 个.

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,

解决方案

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.

这篇关于为什么在 Rails 中不推荐使用 auto_link?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆