replace class_eval by define_method in active_record/relation

The class_eval version is slower than the define_method version.
(http://tenderlovemaking.com/2013/03/03/dynamic_method_definitions.html)

modified:   activerecord/lib/active_record/relation/query_methods.rb