-
Notifications
You must be signed in to change notification settings - Fork 41
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
refactor update the project / workflow contents #2289
refactor update the project / workflow contents #2289
Conversation
…se#2169)" (zooniverse#2267)" This reverts commit 69abc6c.
ensure the parent model gets the updated_at timestamp touched to invalidate any cache keys
yield ps if block_given? | ||
content = ps.slice(*content_fields) | ||
content[:language] = ps[:primary_language] | ||
if ps.has_key? :urls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Hash#key? instead of Hash#has_key?.
end | ||
reject_live_project_changes(workflow, update_params) | ||
def build_update_hash(update_params, resource) | ||
if update_params.has_key? :tasks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Hash#key? instead of Hash#has_key?.
resource.tags = tags unless tags.nil? | ||
|
||
if !content_attributes.blank? || !tags.nil? | ||
resource.updated_at = Time.zone.now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should probably just allow the tag belongs_to to touch the project resource here instead of manually setting the TS for the save action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but it'd be nice to test this out on staging
closes #2212, second attempt at #2169
Refactor the controller actions to not require the content relations in the extended_cache_key. Also ensure we touch the parent translated resource when updating the content child relations, think just content updates like workflow task text changes.
Review checklist
apiary.apib
file?