Delegate to visit instead of calling `.id` directly

This is related to #348

Translation of an ActiveRecord::Base object to an integer should be defined once (i.e. in visit_ActiveRecord_base). This makes it easier for the case when a user does not want to query by `id` but some other field, for example `persistent_id`