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

don't allow to delete message while being sent #539

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

richardlences
Copy link
Contributor

No description provided.

@richardlences
Copy link
Contributor Author

@jsuchal @luciajanikova riesenie #522

redirect_to redirect_path, notice: "Správa bola zahodená"
if @message.not_yet_submitted?
@message.destroy
redirect_to redirect_path, notice: "Správa bola zahodená"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
redirect_to redirect_path, notice: "Správa bola zahodená"
redirect_to redirect_path, notice: "Správa bola zmazaná"

@message.destroy
redirect_to redirect_path, notice: "Správa bola zahodená"
else
redirect_to redirect_path, alert: "Správu nie je možné zmazať po odoslaní"
Copy link
Member

Choose a reason for hiding this comment

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

@luciajanikova je to ze po odoslani alebo pocas odosielania alebo ako to je?

Copy link
Member

Choose a reason for hiding this comment

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

Po zaradeni na odoslanie (tak to volame v aplikacii) - t.j. ani pocas odosielania, ani po odoslani.

Copy link
Member

@jsuchal jsuchal left a comment

Choose a reason for hiding this comment

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

@richardlences vies tu pridat aj test na toto?

Copy link
Member

@jsuchal jsuchal left a comment

Choose a reason for hiding this comment

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

Pozri komenty

@luciajanikova
Copy link
Member

@richardlences zvladnes/skusit pridat aj test? Ak nie, povedz, mozem dorobit aj ja.

@richardlences
Copy link
Contributor Author

@richardlences zvladnes/skusit pridat aj test? Ak nie, povedz, mozem dorobit aj ja.

Skusim pridat, dam vediet ak mi to nepojde

session[:user_id] = Current.user.id
end
test "should destroy draft with status created" do
# draft should be destroyed if not yet submitted
Copy link
Member

Choose a reason for hiding this comment

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

Tento koment mal byt vlastne nazov testu.

@@ -28,7 +28,7 @@ def destroy
message_drafts_to_destroy_ids = message_threads.map(&:message_drafts).flatten.map(&:id)

message_threads.transaction do
MessageDraft.where(id: message_drafts_to_destroy_ids).destroy_all
MessageDraft.not_in_submission_process.where(id: message_drafts_to_destroy_ids).destroy_all
Copy link
Member

Choose a reason for hiding this comment

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

@luciajanikova nie je toto nejako zavadzajuce, ze oznacis nieco na odoslanie a ono sa to neodosle vlastne (lebo to uz je zaradene na odoslanie). Ci to je by design takto?

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.

3 participants