Class: Decidim::Verifications::CsvCensus::Status

Inherits:
Object
  • Object
show all
Defined in:
app/models/decidim/verifications/csv_census/status.rb

Instance Method Summary collapse

Constructor Details

#initialize(organization) ⇒ Status

Returns a new instance of Status.



7
8
9
# File 'app/models/decidim/verifications/csv_census/status.rb', line 7

def initialize(organization)
  @organization = organization
end

Instance Method Details

#countObject



17
18
19
20
# File 'app/models/decidim/verifications/csv_census/status.rb', line 17

def count
  @count ||= CsvDatum.inside(@organization)
                     .distinct.count(:email)
end

#last_import_atObject



11
12
13
14
15
# File 'app/models/decidim/verifications/csv_census/status.rb', line 11

def last_import_at
  @last ||= CsvDatum.inside(@organization)
                    .order(created_at: :desc).first
  @last ? @last.created_at : nil
end