class Department < ActiveRecord::Base
attr_accessible :Department_Id, :DepartmentName,:LocationID
set_primary_key :Department_Id
has_many :Employee
end
导轨控制台:
dept=Department.find(50)
dept.Employee
SELECT `employees`.* FROM `employees` WHERE `employees`.`Department_Id` IS NULL
为什么它在where子句中附加NULL,我期待看到50。我做错了什么