Use Rails 3's ActiveSupport core extensions outside rails

安稳与你 提交于 2019-12-18 10:26:36

问题


I'm having a problem using ActiveSupport's core extensions on a gem I am developing.

I had it working with AS 2.3.8, but as soon as I wanted to port it to 3b4, the extensions stopped working and my test results are filled with lines such as:

undefined method `blank?' for "something":String

I've included it via gem "activesupport" followed by require "active_support"

Is there anything else I need to call to include those extensions?

Thanks


回答1:


ActiveSupport is more separate now in Rails 3.

If you want the all active_support thing, you can require 'active_support/all' now.

But if you want only the blank? method, you can try require 'active_support/core_ext/string'



来源:https://stackoverflow.com/questions/3053119/use-rails-3s-activesupport-core-extensions-outside-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!