Class: Import

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/import.rb

Overview

Import of formulas

Author:

  • guillaumeh

Class Method Summary collapse

Class Method Details

.last_succes_date_or_todayDate

Get the date to filter the formulas.

Returns:

  • (Date)

    Latest import date otherwise today's date


22
23
24
25
# File 'app/models/import.rb', line 22

def self.last_succes_date_or_today
  import = Import.success.last
  import ? import.ended_at.try(:to_date) : Time.now.utc.to_date
end