fixed small bug in model class relation
moved get_fields_with_model to the new API