made some big changes here. The schedule had a has_one relationship with the PTO model. That is a problem since we only get one result back. meaning, a user cant have multiple scheduled events. This has been fixed with the use of has_many within the PTO model. Now, in relation to the PTO section, the next changes to happen are to be a fully functional create action that allows an event to be schedule, the form and controller has already been created. Umm, also, a calendar has been added and when we get the results back from a call to the create event action we will update that calendar. Think that is about it for now
This commit is contained in:
@@ -1,7 +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
|
||||
has_many :schedule, :foreign_key => :user_id, :primary_key => :user_id
|
||||
|
||||
def sick_days_remaining
|
||||
self.sick_days_earned - self.sick_days_taken
|
||||
|
||||
Reference in New Issue
Block a user