adding support for has_many and has_one relations