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

Fix using non-existent Rails method #172

Merged
merged 1 commit into from
Nov 30, 2020
Merged

Conversation

benthorner
Copy link
Contributor

Previously we used ".present?" to check for from/to attributes, but
these methods are only available in Rails app. This switches to using
standard library methods to ensure the code works in all our apps.

Example error:

Uncaught exception from consumer #<Bunny::Consumer:50260 @channel_id=1 @Queue=email_unpublishing>
@consumer_tag=bunny-1606752847000-821140807868>: #<NoMethodError: undefined method present?' for 2020-11-30 22:00:00 +0000:Time> @ /data/vhost/email-alert-service/shared/bundle/ruby/2.7.0/ gems/govuk_app_config-2.7.0/lib/govuk_app_config/govuk_error/govuk_data_sync.rb:31:in in_progress?'

Previously we used ".present?" to check for from/to attributes, but
these methods are only available in Rails app. This switches to using
standard library methods to ensure the code works in all our apps.

Example error:

Uncaught exception from consumer #<Bunny::Consumer:50260 @channel_id=1 @Queue=email_unpublishing>
@consumer_tag=bunny-1606752847000-821140807868>: #<NoMethodError: undefined method `present?'
for 2020-11-30 22:00:00 +0000:Time> @ /data/vhost/email-alert-service/shared/bundle/ruby/2.7.0/
gems/govuk_app_config-2.7.0/lib/govuk_app_config/govuk_error/govuk_data_sync.rb:31:in `in_progress?'
Copy link
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

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

Argh! Thanks Ben.

@benthorner benthorner merged commit 3583bc3 into master Nov 30, 2020
@benthorner benthorner deleted the fix-data-sync-error branch November 30, 2020 17:26
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.

2 participants