define select method to compatible with select method in Rails