Class: CrewDuty

Inherits:
Object show all
Defined in:
lib/models/crew_duty.rb

Class Method Summary collapse

Class Method Details

.find_crew_duty_in_time_range(from_date, to_date) ⇒ Object

Fetches the crew duty records in a given interval



132
133
134
135
136
137
138
# File 'lib/models/crew_duty.rb', line 132

def self.find_crew_duty_in_time_range(from_date, to_date)
  # Fetching the records verified or amended in the time interval passed in
  filter(
    {:verified=>1, :amended=>0, :verified_date=>from_date.to_fos_days..to_date.to_fos_days} |
    {:verified=>1, :amended=>1, :amended_date=>from_date.to_fos_days..to_date.to_fos_days}
  ).all
end