Получение ошибки:
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]
APP_CONFIG загружаются нормально.
account_type = 'sample'
allowed = APP_CONFIG['account']["#{account_type}"]['highlight']
Ошибка указывает на строку разрешенных переменных.
Метод, который я сейчас пытаюсь использовать:
def self.allow_highlight?(account)
account_type = Account.find(account).active_pack # returning a string - OK
logger.debug account_type.class # checked on console - OK
allowed = APP_CONFIG['account']["#{account_type}"]['highlight'] # Error line
if total_account_highlight > allowed
false
else
true
end
end
Надеюсь, вы понимаете.
Любые сомнения, пожалуйста, спросите меня.
Спасибо!