mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 03:36:44 +08:00
using dig method now
This commit is contained in:
parent
29aea1ebd2
commit
350f12bdbc
1 changed files with 2 additions and 19 deletions
|
@ -151,25 +151,8 @@ module ProtocolsIoHelper
|
|||
end
|
||||
|
||||
def step_hash_null?(step_json)
|
||||
is_null_check = false
|
||||
if step_json.blank?
|
||||
is_null_check = true
|
||||
elsif step_json[0].blank?
|
||||
is_null_check = true
|
||||
elsif step_json[0]['components'].blank?
|
||||
is_null_check = true
|
||||
elsif step_json[0]['components'][0].blank?
|
||||
is_null_check = true
|
||||
elsif step_json[0]['components'][0]['component_type_id'].blank?
|
||||
is_null_check = true
|
||||
else
|
||||
is_null_check = false
|
||||
end
|
||||
if is_null_check
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
return true if step_json.dig(0, 'components', 0, 'component_type_id').nil?
|
||||
false
|
||||
end
|
||||
|
||||
# Images are allowed in:
|
||||
|
|
Loading…
Reference in a new issue