Skip to content

Commit

Permalink
avoid error in Docker uploading a datafile with no assays
Browse files Browse the repository at this point in the history
added a dummy line to instantiate an Assay, which helps avoid an error later when attempting to access a method on an unmarshalled assay instance from the session. The error involved attempting to call super within a module, before the Assay class had yet been encountered for that process.
  • Loading branch information
stuzart committed Jun 19, 2018
1 parent ac4cbce commit 7be0254
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/data_files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,11 @@ def rightfield_extraction_ajax
def provide_metadata
@data_file ||= session[:processed_datafile]
@assay ||= session[:processed_assay]

#this perculiar line avoids a no method error when calling super later on, when there are no assays in the database
# this I believe is caused by accessing the unmarshalled @assay before the Assay class has been encountered. Adding this line
# avoids the error
Assay.new
@warnings ||= session[:processing_warnings] || []
@exception_message ||= session[:extraction_exception_message]
@create_new_assay = !(@assay.title.blank? && @assay.description.blank?)
Expand Down

0 comments on commit 7be0254

Please sign in to comment.