search for: maximum_worktime_per_day

Displaying 1 result from an estimated 1 matches for "maximum_worktime_per_day".

2013 Mar 26
0
nested forms: use validate :some_method works in update mode only
...has_many :activities, dependent: :destroy, inverse_of: :timesheet has_many :time_entries, through: :activities accepts_nested_attributes_for :activities, allow_destroy: true validates :user_id, presence: true validates :status, presence: true, inclusion: {in: STATUS_VALUES} validate :maximum_worktime_per_day after_update :check_an_activity_present after_initialize :init_working_week .. private def maximum_worktime_per_day time_entries_by_date = time_entries.group_by(&:workdate) time_entries_by_date.each do |key, value| errors[:base] << "Maximum daily time...