Class: WorkLock
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- WorkLock
- Extended by:
- UserSystem
- Defined in:
- app/models/work_lock.rb
Class Method Summary collapse
Class Method Details
.find_by_week(year, week) ⇒ Object
6 7 8 9 10 |
# File 'app/models/work_lock.rb', line 6 def self.find_by_week(year, week) first_date = Date.commercial(year, week, 1) last_date = first_date + 6 result = self.find(:first, :conditions => ['user_id = ? AND start_on <= ? AND end_on >= ?', current_user.id, first_date, last_date]) end |