I am setting this up, in this way, so that we have some extensibility. We may wish to have some sort of a polymorphic association where multiple models need to have a scheduling model available to them. That being said, as of right now, only the pto model needs it so I am doing a belong_to and has_one association between the two
This commit is contained in:
+24
@@ -104,6 +104,26 @@ paid_time_off = [
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
schedule = [
|
||||
{
|
||||
:user_id => 2,
|
||||
|
||||
},
|
||||
{
|
||||
:user_id => 3,
|
||||
|
||||
},
|
||||
{
|
||||
:user_id => 4,
|
||||
|
||||
},
|
||||
{
|
||||
:user_id => 5,
|
||||
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
|
||||
users.each do |user_info|
|
||||
@@ -116,4 +136,8 @@ end
|
||||
|
||||
paid_time_off.each do |pto|
|
||||
PaidTimeOff.create!(pto)
|
||||
end
|
||||
|
||||
schedule.each do |event|
|
||||
Schedule.create!(event)
|
||||
end
|
||||
Reference in New Issue
Block a user