Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KG - RMID Validated Flag When RMID Removed #2268

Merged
merged 1 commit into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/helpers/protocols_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def archive_protocol_button(protocol, opts={})
end

def display_rmid_validated_protocol(protocol, option)
if Setting.get_value("research_master_enabled") && protocol.rmid_validated?
if Setting.get_value("research_master_enabled") && protocol.research_master_id.present? && protocol.rmid_validated?
content_tag(:h6, t("protocols.rmid.validated", title: option), class: "text-success")
end
end
Expand Down
6 changes: 6 additions & 0 deletions app/models/protocol.rb
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@ def self.to_csv(protocols)
where.not(sub_service_requests: {status: 'first_draft'})
}

def research_master_id=(rmid)
self.rmid_validated = false if rmid.blank?

super(rmid)
end

def validate_dates
is_valid = true
if self.start_date.blank?
Expand Down