Skip to content

Implement automatic propagation of a started status from tasks to experiments and projects [SCI-11797] #8426

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

okriuchykhin
Copy link
Contributor

@okriuchykhin okriuchykhin commented Apr 15, 2025

Jira ticket: SCI-11797

What was done

Implement automatic propagation of a started status from tasks to experiments and projects


def down
Project.where.not(started_at: nil).update_all(started_at: nil)
Experiment.where.not(started_at: nil).update_all(started_at: nil)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rails/SkipsModelValidations: Avoid using update_all because it skips validations.

end

def down
Project.where.not(started_at: nil).update_all(started_at: nil)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rails/SkipsModelValidations: Avoid using update_all because it skips validations.

.joins(experiments: { my_modules: :my_module_status })
.where(started_at: nil)
.where.not(experiments: { my_modules: { my_module_statuses: { name: NOT_STARTED_STATUS } } })
.update_all(started_at: started_at)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rails/SkipsModelValidations: Avoid using update_all because it skips validations.

.joins(my_modules: :my_module_status)
.where(started_at: nil)
.where.not(my_modules: { my_module_statuses: { name: NOT_STARTED_STATUS } })
.update_all(started_at: started_at)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rails/SkipsModelValidations: Avoid using update_all because it skips validations.

artoscinote
artoscinote previously approved these changes Apr 15, 2025
@artoscinote artoscinote changed the base branch from features/project-management to develop May 26, 2025 12:07
@artoscinote artoscinote dismissed their stale review May 26, 2025 12:07

The base branch was changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants