Skip to content

Conversation

@mllocs
Copy link
Collaborator

@mllocs mllocs commented Sep 24, 2018

In order to send a PushNotification, the model must have non blank title and body. While testing the PushNotification creator we created some invalid models in production (and probably other envs).

Here I'm adding the validations and a migration to mark those invalid notifications as processed.

@mllocs
Copy link
Collaborator Author

mllocs commented Sep 24, 2018

unless push_notification.valid?
now = Time.now.utc
push_notification.update_columns(processed_at: now, updated_at: now)
puts "Updating invalid PushNotification ##{push_notification.id}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Rails logger?

@enricostano
Copy link
Contributor

Tested in staging 🍏

@enricostano enricostano merged commit cd18f3e into develop Sep 25, 2018
@enricostano enricostano deleted the fix/invalid-push-notifications branch September 25, 2018 11:00
@enricostano enricostano mentioned this pull request Sep 25, 2018
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