Class: MissingText::Batch

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.history_options(batch) ⇒ Object

every batch except this one



8
9
10
# File 'app/models/missing_text/batch.rb', line 8

def self.history_options(batch)
  MissingText::Batch.where("id != ?", batch.id).order('created_at DESC')
end

Instance Method Details

#created_timeObject



12
13
14
# File 'app/models/missing_text/batch.rb', line 12

def created_time
  self.created_at.strftime('%b %e, %Y at %H:%M:%S')
end

#entriesObject



20
21
22
# File 'app/models/missing_text/batch.rb', line 20

def entries
  MissingText::Entry.where("missing_text_records_id in (?)", MissingText::Record.where(missing_text_batch_id: self.id).pluck(:id))
end

#high_entry_countObject



16
17
18
# File 'app/models/missing_text/batch.rb', line 16

def high_entry_count
  500
end

#high_entry_count?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'app/models/missing_text/batch.rb', line 24

def high_entry_count?
  entries.count >= high_entry_count
end