1

I've opened a class (from the OmniAuth Identity library) to alter the forms it produces. The library uses autoload, so in order for the patch to work I need to force the library to load, but what I've tried so far results in errors, this is my best guess so far:

OmniAuth::Strategies::Identity if autoload? OmniAuth::Strategies::Identity

uninitialized constant OmniAuth::Strategies::Identity (NameError)

Would anyone be able to tell me how this can be done? Any help or insight will be much appreciated.

Ruby v1.9.x
OmniAuth Identity v1.1.0

4

2 に答える 2

0

自動ロードはステートメントの数を減らすための魔法の方法であるため、requireこれを使用して特定のファイルのロードを強制できます。

require 'omniauth/strategies/identity'
于 2012-11-18T20:46:16.613 に答える
0

単にロードしたいだけの場合、ロードを確実にするためのコードとして以下を使用することはできませんか?

OmniAuth::Strategies::Identity

于 2012-11-18T20:56:07.763 に答える