rails 4 fix and support for 'OR' queries