Created
May 10, 2011 20:15
-
-
Save jaredholdcroft/965285 to your computer and use it in GitHub Desktop.
Has_one problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Audit < ActiveRecord::Base | |
has_many :audit_items | |
belongs_to :auditor | |
belongs_to :contact | |
belongs_to :site | |
has_one :requested_by, :class_name => "Employee", :primary_key => "requested_by", :foreign_key => "id" | |
end | |
# This basically links to an Employee object but rather than employee_id it uses requested_by to store the id of | |
# the employee |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment