No implicit conversion of Symbol into Integer only happening sometimes

By Avin A Good-time Chadee

Can someone explain what I’m doing wrong!?

   if response[:result]
      response[:credentials].each do |cred|
        AntHQ.logger.debug "==> #{cred}"
        c = app_instance.credentials.find_by(name: cred[:name])
        if c && cred[:value]
          c.value = cred[:value]
          c.expiry = cred[:expiry]
          c.save!
        end
      end
    end

Error

TypeError: no implicit conversion of Symbol into Integer1
File "/usr/local/lib/ruby/gems/2.1.0/bundler/gems/ant_light_tasks-01095a3ea065/lib/ant_light_tasks/app/update_credentials.rb" line 16 in []

Line 16:

 c.value = cred[:value]

Example “response”:

{:result=>true, :credentials=>[{:name=>"access_token", :value=>"...", :expiry=>"..."}]}

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273