LoginEngine と ActionMailer
気づきを。
vendor/plugins/login_engine/app/models/user_notify.rb を見てて LoginEngine.config というメソドの呼び出しが所々にある。例えば以下のメソド。
def setup_email(user) @recipients = "#{user.email}" @from = LoginEngine.config(:email_from).to_s @subject = "[#{LoginEngine.config(:app_name)}] " @sent_on = Time.now @headers['Content-Type'] = "text/plain; charset=#{LoginEngine.config(:mail_c harset)}; format=flowed" end
これは一体ドコが出自ですか??ってコトで調べてみるに、デフォなナニは vendor/plugins/login_engine/lib/login_engine.rb にて設定されている模様。中身の引用は略しますが、ここでやたらに呼ばれている config というメソドの出自はどこだ (多分 AuthenticatedSystem と類推してるんですが、とりあえず略)。
で、ここでデフォなナニを設定しといて、変更したいんだったら config/environment.rb でね、というのが基本的な使い方らしい。現状の設定を見てみたら微妙スギで引用する気にならん。ここも修正しておく必要あり、だなぁ。
別途、config の根拠が分かったらエントリ投入予定。
追記
類推はダウトが判明。
./script/console で無理矢理調べる。
$ ruby ./script/console test irb(main):001:0> LoginEngine.config RuntimeError: config expects at least one argument from ./script/../config/../vendor/plugins/engines/lib/engines/ruby_extensions.rb:80:in `config' from (irb):1 irb(main):002:0>
で、何故にココからナニなのだ、と思いつつソースを睨むと以下のコメントがソースの冒頭に記述されていた。
#-- # Add these methods to the top-level module so that they are available in all # modules, etc #++
うーむ。結構無理矢理だなぁ。
追記 2
調べ方も相当無理矢理。