Given the following models:
User.rb
NetworkDepartment.rb (id, title,added_by)
belongs_to :user, :foreign_key => :added_by
I want to be able to create a network department and have the added_by assigned automatically. I have the following:
@network_department = current_user.network_departments.new(params[:network_department])
Why isn't current_user automatically setting added_by as the current_user.id ?
Thanks