title: rails belongs to conflict?
body: <p>sorry if a similar question has been posted before, i didn't know what terms to use to search for it.</p>
  
  <p>i have a model 'vehicle_workshop', it stores both vehicles and workshop data, there are is column called 'type' to distinguish between the two, 'workshop_no' column serves as a name</p>
  
  <p>now i have another model 'workshop distributions', it uses both vehicles and workshops, i am able to create a relationship as follows </p>
  
  <pre><code>belongs_to :vehicle_workshop
  belongs_to :vehicle_workshop, :foreign_key =&gt; "vehicle_id"
  </code></pre>
  
  <p>this allows me to save the data, with no issues, the two forign key fields are 'vehicle_workshop_id' for workshops and 'vehicle_id' for vehicles.</p>
  
  <p>now the problems is when i want to access the registration no, i.e the field 'workshop_no' for both vehicles and workshops.</p>
  
  <p>i have 2 attr_accessor's , 'vehicle_no' , 'workshop_no'</p>
  
  <p>the methods are as follows</p>
  
  <pre><code>def vehicle_no
      self.vehicle_workshop ? self.vehicle_workshop.workshop_no : nil
  end
  
  def workshop_no
      self.vehicle_workshop ? self.vehicle_workshop.workshop_no : nil
  end
  </code></pre>
  
  <p>both these functions returns the same value, how will i pass the appropriate id values to both these functions? say 'vehicle_id' and 'vehicle_workshop_id' ?</p>
  
  <p>any help would be greatly appreciated. </p>