Skip to content

Instantly share code, notes, and snippets.

@snoblenet
Created June 21, 2015 06:17
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 snoblenet/be1846b9c2e3e4cb8368 to your computer and use it in GitHub Desktop.
Save snoblenet/be1846b9c2e3e4cb8368 to your computer and use it in GitHub Desktop.
other errors
NoMethodError in ReviewsController#preview
undefined method `to_sym' for nil:NilClass
Extracted source (around line #59):
57
58
59
60
61
62
expanded_attrs = {}
attrs.each do |attr, value|
if aggregation = reflect_on_aggregation(attr.to_sym)
mapping = aggregation.mapping
mapping.each do |field_attr, aggregate_attr|
if mapping.size == 1 && !value.respond_to?(aggregate_attr)
Rails.root: /Users/steven/code/testivate
Application Trace | Framework Trace | Full Trace
activerecord (4.2.0) lib/active_record/sanitization.rb:59:in `block in expand_hash_conditions_for_aggregates'
activerecord (4.2.0) lib/active_record/sanitization.rb:58:in `each'
activerecord (4.2.0) lib/active_record/sanitization.rb:58:in `expand_hash_conditions_for_aggregates'
activerecord (4.2.0) lib/active_record/relation/query_methods.rb:955:in `build_where'
activerecord (4.2.0) lib/active_record/relation/query_methods.rb:584:in `where!'
activerecord (4.2.0) lib/active_record/relation/query_methods.rb:574:in `where'
activerecord (4.2.0) lib/active_record/relation.rb:82:in `_update_record'
activerecord (4.2.0) lib/active_record/persistence.rb:512:in `_update_record'
activerecord (4.2.0) lib/active_record/locking/optimistic.rb:70:in `_update_record'
activerecord (4.2.0) lib/active_record/attribute_methods/dirty.rb:123:in `_update_record'
activerecord (4.2.0) lib/active_record/callbacks.rb:310:in `block in _update_record'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:734:in `_run_update_callbacks'
activerecord (4.2.0) lib/active_record/callbacks.rb:310:in `_update_record'
activerecord (4.2.0) lib/active_record/timestamp.rb:70:in `_update_record'
activerecord (4.2.0) lib/active_record/persistence.rb:501:in `create_or_update'
activerecord (4.2.0) lib/active_record/callbacks.rb:302:in `block in create_or_update'
activesupport (4.2.0) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:92:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:92:in `_run_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:734:in `_run_save_callbacks'
activerecord (4.2.0) lib/active_record/callbacks.rb:302:in `create_or_update'
activerecord (4.2.0) lib/active_record/persistence.rb:120:in `save'
activerecord (4.2.0) lib/active_record/validations.rb:37:in `save'
activerecord (4.2.0) lib/active_record/attribute_methods/dirty.rb:21:in `save'
activerecord (4.2.0) lib/active_record/transactions.rb:286:in `block (2 levels) in save'
activerecord (4.2.0) lib/active_record/transactions.rb:347:in `block in with_transaction_returning_status'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
activerecord (4.2.0) lib/active_record/transactions.rb:220:in `transaction'
activerecord (4.2.0) lib/active_record/transactions.rb:344:in `with_transaction_returning_status'
activerecord (4.2.0) lib/active_record/transactions.rb:286:in `block in save'
activerecord (4.2.0) lib/active_record/transactions.rb:301:in `rollback_active_record_state!'
activerecord (4.2.0) lib/active_record/transactions.rb:285:in `save'
/Users/steven/.rvm/gems/ruby-2.1.3/bundler/gems/activerecord-session_store-a30ec3117d18/lib/action_dispatch/session/active_record_store.rb:77:in `set_session'
rack (1.6.0) lib/rack/session/abstract/id.rb:342:in `commit_session'
rack (1.6.0) lib/rack/session/abstract/id.rb:226:in `context'
rack (1.6.0) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.0) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
web-console (2.0.0) lib/action_dispatch/debug_exceptions.rb:18:in `middleware_call'
web-console (2.0.0) lib/action_dispatch/debug_exceptions.rb:13:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.0) lib/rails/rack/logger.rb:22:in `call'
request_store (1.1.0) lib/request_store/middleware.rb:8:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.0) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.0) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.0) lib/rack/lock.rb:17:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.0) lib/rack/sendfile.rb:113:in `call'
railties (4.2.0) lib/rails/engine.rb:518:in `call'
railties (4.2.0) lib/rails/application.rb:164:in `call'
railties (4.2.0) lib/rails/railtie.rb:194:in `public_send'
railties (4.2.0) lib/rails/railtie.rb:194:in `method_missing'
rack (1.6.0) lib/rack/lint.rb:49:in `_call'
rack (1.6.0) lib/rack/lint.rb:37:in `call'
rack (1.6.0) lib/rack/showexceptions.rb:24:in `call'
rack (1.6.0) lib/rack/commonlogger.rb:33:in `call'
sinatra (1.4.5) lib/sinatra/base.rb:217:in `call'
rack (1.6.0) lib/rack/chunked.rb:54:in `call'
rack (1.6.0) lib/rack/content_length.rb:15:in `call'
unicorn (4.8.3) lib/unicorn/http_server.rb:576:in `process_client'
unicorn (4.8.3) lib/unicorn/http_server.rb:670:in `worker_loop'
unicorn (4.8.3) lib/unicorn/http_server.rb:525:in `spawn_missing_workers'
unicorn (4.8.3) lib/unicorn/http_server.rb:140:in `start'
unicorn (4.8.3) bin/unicorn:126:in `<top (required)>'
/Users/steven/.rvm/gems/ruby-2.1.3/bin/unicorn:23:in `load'
/Users/steven/.rvm/gems/ruby-2.1.3/bin/unicorn:23:in `<main>'
/Users/steven/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `eval'
/Users/steven/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `<main>'
Request
Parameters:
{"item"=>"28",
"page"=>"element",
"id"=>"60"}
Toggle session dump
Toggle env dump
Response
Headers:
None
>>
@tischler
Copy link

I'm curious. I have this exact same stacktrace and found this gist searching for it. What was it?

@andersonfernandes
Copy link

I'm having the same issue.
The gist is quite old, but do you remember the solution or have some idea of how to solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment