Update model extension.rb to fix #82

Now, association_class query is made generic (by primary_key), not by id. Useful where primary_key has been changed for another attribute.