Skip to content

Instantly share code, notes, and snippets.

@JustinAiken
Created December 20, 2012 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JustinAiken/4346524 to your computer and use it in GitHub Desktop.
Save JustinAiken/4346524 to your computer and use it in GitHub Desktop.
wtf?
1.9.2p320 :001 > @call_flow = CallFlow.find_by_id(7107)
=> #<CallFlow id: 7107, provisioned_route_id: 1147, dnis: "2162019670", message: "blank", default_ringto: "0000000000", ouid: 170, caller_to_sms: nil, email_to_notify: nil, play_disclaimer: "before", created_at: "2012-12-19 18:43:14", updated_at: "2012-12-20 16:11:38", country_code: "1", tx_boost: nil, rx_boost: nil, vm_enabled: nil, routable_type: "OutboundRoute", routable_id: 5, webhook_enabled: nil>
1.9.2p320 :002 > call_flow_params = {:country_code=>"1", :ouid=>"170", :dnis=>"2162019670", :message=>"blank", :play_disclaimer=>"before"}
=> {:country_code=>"1", :ouid=>"170", :dnis=>"2162019670", :message=>"blank", :play_disclaimer=>"before"}
1.9.2p320 :003 > @call_flow.update_attributes(call_flow_params)
NameError: undefined local variable or method `to_ary' for #<CallFlow:0xa968ef8>
from /home/jaiken/.rvm/gems/ruby-1.9.2-p320@callengine/gems/activemodel-3.0.8/lib/active_model/attribute_methods.rb:392:in `method_missing'
from /home/jaiken/.rvm/gems/ruby-1.9.2-p320@callengine/gems/activerecord-3.0.8/lib/active_record/attribute_methods.rb:46:in `method_missing'
from /var/www/vhosts/api.logmycalls.com/app/models/call_flow.rb:18:in `method_missing'
from /home/jaiken/.rvm/gems/ruby-1.9.2-p320@callengine/gems/activerecord-3.0.8/lib/active_record/connection_adapters/abstract/database_statements.rb:319:in `flatten'
from /home/jaiken/.rvm/gems/ruby-1.9.2-p320@callengine/gems/activerecord-3.0.8/lib/active_record/connection_adapters/abstract/database_statements.rb:319:in `commit_transaction_records'
from /home/jaiken/.rvm/gems/ruby-1.9.2-p320@callengine/gems/activerecord-3.0.8/lib/active_record/connection_adapters/abstract/database_statements.rb:165:in `transaction'
from /home/jaiken/.rvm/gems/ruby-1.9.2-p320@callengine/gems/activerecord-3.0.8/lib/active_record/transactions.rb:207:in `transaction'
from /home/jaiken/.rvm/gems/ruby-1.9.2-p320@callengine/gems/activerecord-3.0.8/lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
from /home/jaiken/.rvm/gems/ruby-1.9.2-p320@callengine/gems/activerecord-3.0.8/lib/active_record/persistence.rb:130:in `update_attributes'
from (irb):3
from /home/jaiken/.rvm/gems/ruby-1.9.2-p320@callengine/gems/railties-3.0.8/lib/rails/commands/console.rb:44:in `start'
from /home/jaiken/.rvm/gems/ruby-1.9.2-p320@callengine/gems/railties-3.0.8/lib/rails/commands/console.rb:8:in `start'
from /home/jaiken/.rvm/gems/ruby-1.9.2-p320@callengine/gems/railties-3.0.8/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
1.9.2p320 :004 > @call_flow.update_attributes({})
=> true
1.9.2p320 :005 > @call_flow.update_attributes(call_flow_params)
=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment