Skip to content

Commit

Permalink
Merge pull request #1262 from common-group/feature/keep-projects-remi…
Browse files Browse the repository at this point in the history
…nders

✨ Remove logica que deleta os projects_reminders ao desativar uma lan…
  • Loading branch information
stephannv authored Mar 28, 2022
2 parents a61a034 + 0a6a952 commit dbd1007
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ def activate
def deactivate
authorize resource, policy_class: ProjectIntegrationPolicy

parent.reminders.destroy_all

resource.destroy

respond_to do |format|
Expand Down
2 changes: 0 additions & 2 deletions services/catarse/app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,6 @@ def notify_reminder_of_publish(options = {})
options
)
end

reminders.destroy_all
end

def delete_from_reminder_queue(user_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
post :activate, params: { format: :json, id: project.id }
end

it 'deactivates coming soon landing page and have 0 reminders' do
it 'deactivates coming soon landing page' do
delete :deactivate, params: { format: :json, id: project.id }
expect(project.reminders.length).to eq(0)
expect(project.integrations.coming_soon.first.present?).to be false
end
end
end
1 change: 0 additions & 1 deletion services/catarse/spec/models/project_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
project.notify_reminder_of_publish

expect(project.notifications.length).to eq(reminders_count)
expect(project.reminders.length).to eq(0)
end
end

Expand Down

0 comments on commit dbd1007

Please sign in to comment.