Class: MissingText::Batch
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- MissingText::Batch
- Defined in:
- app/models/missing_text/batch.rb
Class Method Summary collapse
-
.history_options(batch) ⇒ Object
every batch except this one.
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.(batch) MissingText::Batch.where("id != ?", batch.id).order('created_at DESC') end |
Instance Method Details
#created_time ⇒ Object
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 |
#entries ⇒ Object
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_count ⇒ Object
16 17 18 |
# File 'app/models/missing_text/batch.rb', line 16 def high_entry_count 500 end |
#high_entry_count? ⇒ Boolean
24 25 26 |
# File 'app/models/missing_text/batch.rb', line 24 def high_entry_count? entries.count >= high_entry_count end |