mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-22 03:36:32 +08:00
Hound styling
This commit is contained in:
parent
0086e4dcf3
commit
6ec2c99a28
2 changed files with 11 additions and 18 deletions
|
@ -656,13 +656,11 @@ class ProtocolsController < ApplicationController
|
|||
# where a preview modal is rendered,
|
||||
# and some modals get closed and opened
|
||||
end
|
||||
rescue Exception => e
|
||||
rescue StandardError => e
|
||||
Rails.logger.error(e.message)
|
||||
@protocolsio_general_error = true
|
||||
respond_to do |format|
|
||||
format.js {} # go to the js.erb file named the same as this controller,
|
||||
# where a preview modal is rendered,
|
||||
# and some modals get closed and opened
|
||||
format.js {}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -151,23 +151,19 @@ module ProtocolsIoHelper
|
|||
end
|
||||
|
||||
def pio_eval_authors(text)
|
||||
begin
|
||||
# Extract authors names from the JSON
|
||||
text.map { |auth| auth['name'] }.join(', ')
|
||||
rescue Exception
|
||||
[]
|
||||
end
|
||||
# Extract authors names from the JSON
|
||||
text.map { |auth| auth['name'] }.join(', ')
|
||||
rescue StandardError
|
||||
[]
|
||||
end
|
||||
|
||||
def eval_last_modified(steps)
|
||||
begin
|
||||
timestamps = steps.map do |step|
|
||||
step['modified_on'] if step['modified_on'].present?
|
||||
end
|
||||
Time.at(timestamps.max).utc.to_datetime
|
||||
rescue Exception
|
||||
Time.at(0).utc.to_datetime
|
||||
timestamps = steps.map do |step|
|
||||
step['modified_on'] if step['modified_on'].present?
|
||||
end
|
||||
Time.at(timestamps.max).utc.to_datetime
|
||||
rescue StandardError
|
||||
Time.at(0).utc.to_datetime
|
||||
end
|
||||
|
||||
# Checks so that null values are returned as zero length strings
|
||||
|
@ -522,5 +518,4 @@ module ProtocolsIoHelper
|
|||
[]
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue