Skip to content

Conversation

@caioertai
Copy link

Not sure if this is a generally desired feature, but it seems natural to me that this should be possible since it shares Hash behaviors:

attachments = {
  'test.pdf' => read_raw_fixture('attachments', 'test.pdf'),
  'test.gif' => read_raw_fixture('attachments', 'test.gif'),
  'test.jpg' => read_raw_fixture('attachments', 'test.jpg')
}
mail.attachments.merge!(attachments)

The fact that there's a #merge! without an otherwise expected #merge irks me a bit. But it seems a simple improvement to the class.

Thoughts?

@jeremy jeremy added this to the 2.8.0 milestone Dec 11, 2018
Copy link
Collaborator

@jeremy jeremy left a comment

Choose a reason for hiding this comment

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

Nice addition. Could you fix the test to not expect specific sort ordering and squash your commits? Thanks!

expect(mail.attachments[1].filename).to eq 'test.gif'
expect(mail.attachments[2].filename).to eq 'test.jpg'
expect(mail.attachments[3].filename).to eq 'test.zip'
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hashes are unordered on older Ruby 1.8 so this is breaking CI.

@caioertai
Copy link
Author

caioertai commented Dec 12, 2018

Fixed it. And sorry for not testing on Ruby 1.8.7. Openssl acts up with Ubuntu 18.04. Ran it through a container this time.

@caioertai caioertai changed the title Add #merge support to AttachmentsList Add #merge! support to AttachmentsList Oct 21, 2021
@caioertai
Copy link
Author

It's been a while since I've looked at this. Is there anything I can do here, @jeremy? Thank you.

@caioertai caioertai requested a review from jeremy January 25, 2023 21:44
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