Forum: Ruby on Rails getting error like undefined local variable or method `confi

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8c70506408fddb9740b4de7339055c77?d=identicon&s=25 Prashant Tiwari (tiwaripk)
on 2006-05-03 15:23
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
This topic is locked and can not be replied to.