Class: Renalware::Letters::Batch

Inherits:
ApplicationRecord show all
Includes:
Accountable
Defined in:
app/models/renalware/letters/batch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Accountable

#first_or_create_by!, #save_by, #save_by!, #update_by

Instance Attribute Details

#author_id_eqObject

TODO: I think these attributes are dead



11
12
13
# File 'app/models/renalware/letters/batch.rb', line 11

def author_id_eq
  @author_id_eq
end

#created_by_id_eqObject

TODO: I think these attributes are dead



11
12
13
# File 'app/models/renalware/letters/batch.rb', line 11

def created_by_id_eq
  @created_by_id_eq
end

#enclosures_presentObject

TODO: I think these attributes are dead



11
12
13
# File 'app/models/renalware/letters/batch.rb', line 11

def enclosures_present
  @enclosures_present
end

#letterhead_id_eqObject

TODO: I think these attributes are dead



11
12
13
# File 'app/models/renalware/letters/batch.rb', line 11

def letterhead_id_eq
  @letterhead_id_eq
end

#page_count_in_arrayObject

TODO: I think these attributes are dead



11
12
13
# File 'app/models/renalware/letters/batch.rb', line 11

def page_count_in_array
  @page_count_in_array
end

#sObject

TODO: I think these attributes are dead



11
12
13
# File 'app/models/renalware/letters/batch.rb', line 11

def s
  @s
end

#state_eqObject

TODO: I think these attributes are dead



11
12
13
# File 'app/models/renalware/letters/batch.rb', line 11

def state_eq
  @state_eq
end

#urlObject

TODO: I think these attributes are dead



11
12
13
# File 'app/models/renalware/letters/batch.rb', line 11

def url
  @url
end

Instance Method Details

#percent_completeObject



34
35
36
# File 'app/models/renalware/letters/batch.rb', line 34

def percent_complete
  ((items.where(status: :compiled).count.to_f / batch_items_count) * 100).ceil
end