binarylogic / searchlogic

Searchlogic provides object based searching, common named scopes, and other useful tools.
http://rdoc.info/projects/binarylogic/searchlogic
MIT License
1.39k stars 133 forks source link

Order helper doesn't work with symbols in case of ascend_scope/descend_scope #115

Open tanelj opened 14 years ago

tanelj commented 14 years ago

Order helper doesn't work with symbols in case of ascend_scope/descend_scope. User can't sort descending.

Does not work: <%= order @search, :ascend_scope => :sort_by_report_total_amount_asc, :descend_scope => :sort_by_report_total_amount_desc %>

Works: <%= order @search, :ascend_scope => 'sort_by_report_total_amount_asc', :descend_scope => 'sort_by_report_total_amount_desc' %>

It seems like line in rails.helper.rb Line 30: ascending = search.order.to_s == options[:ascend_scope]

Should be: Line 30: ascending = search.order.to_s == options[:ascend_scope].to_s