activerecord-hackery / meta_search

Object-based searching (and more) for simply creating search forms. Not currently maintained.
http://erniemiller.org/2013/11/17/anyone-interested-in-activerecord-hackery/
MIT License
903 stars 140 forks source link

undefined method `scan' for nil:NilClass #12

Closed knoopx closed 13 years ago

knoopx commented 13 years ago

Exception

undefined method `scan' for nil:NilClass

Backtrace

activesupport (3.0.3) lib/active_support/whiny_nil.rb:48:in `method_missing'
meta_search (0.9.10) lib/meta_search/builder.rb:184:in `set_sort'
meta_search (0.9.10) lib/meta_search/builder.rb:137:in `method_missing'
meta_search (0.9.10) lib/meta_search/builder.rb:126:in `block in assign_attributes'
meta_search (0.9.10) lib/meta_search/builder.rb:125:in `each_pair'
meta_search (0.9.10) lib/meta_search/builder.rb:125:in `assign_attributes'
meta_search (0.9.10) lib/meta_search/builder.rb:100:in `build'
meta_search (0.9.10) lib/meta_search/searches/active_record.rb:32:in `metasearch'

Parameters

{"search"=>{"meta_sort"=>""},  "commit"=>"Search"}
ernie commented 13 years ago

This looks like it overrides changes that were made to support multi-column sorts. Can you rebase against master and submit again? Should probably just pre-empt the whole block with "return if val.blank?" rather than try to wrap so much code in a conditional as well.