add merge_condition method to compatible with rails < 3.0 code