importing more rails 4 compatible code from latest sunspot/sunspot-rails pt 2

 (barf)