Posts by user23618 • 1 point
1 post
-
0
votes3
answers169
viewsA: Conditional relationships
You will declare normally, just make it optional. When you want, you can check if the association exists: u = User.new u.department.nil? => true u.department_id = Department.first…