importing rails 4 compatible adapter code from latest sunspot/sunspot-rails