Skip to content

Conversation

@rishijain
Copy link
Contributor

Jira Ticket

https://ombulabs.atlassian.net/browse/STJ-14

Motivation / Context

Fix for #347

While cloning the stories, I have excluded status of the story alongside some other attributes. Wrote specs to check the behaviour.

QA / Testing Instructions

How do I achieve this behavior? Use the following format to provide a step-by-step guide:

Step 1: create a project and approve/reject some stories
Step 2: clone it
Step 3: new project has some stories, all of them marked as pending.

Screenshots:


I will abide by the code of conduct.

@rishijain rishijain changed the title Fix: clone stories but leave status Fix: clone stories excluding status Apr 22, 2025
Copy link
Contributor

@aisayo aisayo left a comment

Choose a reason for hiding this comment

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

LGTM!

@aisayo aisayo temporarily deployed to points-stj-14-bugfix-rzxtdo1fo April 22, 2025 15:24 Inactive
Copy link
Member

@JuanVqz JuanVqz left a comment

Choose a reason for hiding this comment

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

As for QA, this is working!

It would be nice if the ombu_labs-auth were addressed on a separate ticket, but since we have limited time, please fix it here.

image

image

def clone_stories_into(clone)
stories.each { |story| clone.stories.create(story.dup.attributes) }
stories.each do |story|
attrs = story.dup.attributes.except("status", "id", "created_at", "updated_at")
Copy link
Member

Choose a reason for hiding this comment

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

JFI: we do not need to add the id, created_at, updated_at the dup method removed them already

Suggested change
attrs = story.dup.attributes.except("status", "id", "created_at", "updated_at")
attrs = story.dup.attributes.except(:status)

In the other hand, I was wondering if instead of except attributes we would want to accept only the "clonable" attributes we need, I'm thinking towards the future when someone adds more attributes those will be cloned and maybe we don't want that, makes sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. I have updated.

@JuanVqz JuanVqz merged commit f8a7ea6 into main Apr 24, 2025
3 of 4 checks passed
@JuanVqz JuanVqz deleted the stj-14-bugfix branch April 24, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants