has_many rails 3 and 4 compatibility