Module: DataRelease

Included in:
Study
Defined in:
app/models/data_release.rb

Instance Method Summary collapse

Instance Method Details

#accession_required?Boolean

Returns:

  • (Boolean)


15
16
17
18
19
20
21
22
23
24
25
# File 'app/models/data_release.rb', line 15

def accession_required?
  return false if do_not_enforce_accessioning

  # If the data release fields are filled out correctly, and set to 'never release',
  # then accessioning is not required.
  return false if valid_data_release_properties? && .never_release?

  # It is required unless specified otherwise,
  # to make sure the data is ready for release to the ENA or EGA.
  true
end

#do_not_enforce_accessioningObject

For readability. Makes sense this way round, as the flag is on by default, and must be actively unchecked in the case where accessioning should not be enforced



34
35
36
# File 'app/models/data_release.rb', line 34

def do_not_enforce_accessioning
  !enforce_accessioning
end

#for_array_express?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'app/models/data_release.rb', line 27

def for_array_express?
  (st = .data_release_study_type) && st.for_array_express
end

#valid_data_release_properties?Boolean

TODO: All of this probably falls into the Study::Metadata class

Returns:

  • (Boolean)


5
6
7
8
9
10
11
12
13
# File 'app/models/data_release.rb', line 5

def valid_data_release_properties?
  # If the data is expected to be released, then certain fields must be filled out.
  if enforce_data_release
    return false if .data_release_strategy.try(:blank?)
    return false if .data_release_timing.try(:blank?)
  end

  true
end