mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 13:16:28 +08:00
30 lines
578 B
Ruby
30 lines
578 B
Ruby
module MyModulesHelper
|
|
def ordered_step_of(my_module)
|
|
my_module.protocol.steps.order(:position)
|
|
end
|
|
|
|
def ordered_checklist_items(checklist)
|
|
checklist.checklist_items.order(:position)
|
|
end
|
|
|
|
def ordered_assets(step)
|
|
step.assets.order(:file_updated_at)
|
|
end
|
|
|
|
def number_of_samples(my_module)
|
|
my_module.samples.count
|
|
end
|
|
|
|
def ordered_result_of(my_module)
|
|
my_module.results.where(archived: false).order(created_at: :desc)
|
|
end
|
|
|
|
def is_steps_page?
|
|
action_name == "steps"
|
|
end
|
|
|
|
def is_results_page?
|
|
action_name == "results"
|
|
end
|
|
|
|
end
|