making active record dependency generic