Getting error like undefined local variable or method `confi


#1

Hi,

This is one of the method in “spam_protection.rb” in typo 2.6.0
application.

def article_closed?(record)
if config[‘sp_article_auto_close’] > 0
if record.article.created_at.to_i <
config[‘sp_article_auto_close’].days.ago.to_i
logger.info("[SP] Blocked interaction with
#{record.article.title}")
return true
end
end
end

When I am trying to post comment I am getting error like:-

undefined local variable or method `config’ for
#SpamProtection:0x35ef4d8

Why I am getting this error? Where I am wrong?

Please tell me.
Thanx in advance.
Prash