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:
@@ -1,6 +1,7 @@
|
||||
class PaidTimeOff < ActiveRecord::Base
|
||||
attr_accessible :pto_earned, :pto_taken, :sick_days_earned, :sick_days_taken, :user_id
|
||||
belongs_to :user
|
||||
has_one :schedule, :foreign_key => :user_id, :primary_key => :user_id
|
||||
|
||||
# Refactor this duplication when it's not 3am
|
||||
def sick_days_remaining(val="")
|
||||
|
||||
Reference in New Issue
Block a user