Skip to content

Fix message status datetime not showing in MessageBird::Recipient object #81

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

karissekjw
Copy link

@karissekjw karissekjw commented Sep 20, 2022

Issue

Based on MessageBird's API documentation, MessageBird::Recipient object contains statusDatetime. But the library is currently throwing an error when attempting to retrieve status_datetime

NoMethodError: undefined method `status_datetime' for #<MessageBird::Recipient:0x00000001125047a0 @recipient=6581825086, @status="delivered">

Solution

After some digging, notice that this bug is due to incorrect method name when executing map_hash_elements_to_self method in Message::Base. This PR renames the method so elements can be mapped to the method correctly and retrieve statusDatetime successfully

After this fix, the object looks like this:

<MessageBird::Recipient:0x00000001172fd8a8 @recipient=6581825086, @status="delivered", @status_datetime=2022-09-20 06:17:51 +0000>

Also added a test case to ensure that the change works as expected

@karissekjw karissekjw changed the title fix incorrect method name Fix message status datetime not showing in MessageBird::Recipient object Sep 20, 2022
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