Associations not working on form

There is wrong check if associations are activated as $app->item_associations always contains 0 before associations are created, replacing this by core Joomla function, I also added class check for j 2.5.