added scope param to has_many and habtm for rails 4