You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I include JSON::Serializable in my emails to have them sent in the background with Mel. Since Carbon v0.5, I get a compile error:
Showing last frame. Use --error-trace for full trace.
There was a problem expanding macro 'macro_139862332317072'
Code in /path/to/.crenv/versions/1.11.2/share/crystal/src/json/from_json.cr:271:3
271 | {% begin %}
^
Called macro defined in /path/to/.crenv/versions/1.11.2/share/crystal/src/json/from_json.cr:271:3
271 | {% begin %}
Which expanded to:
> 27 |
> 28 | when "io"
> 29 | __temp_4884 = self[:io].new(pull)
^--
Error: wrong number of arguments for 'IO::ARGF#initialize' (given 1, expected 2)
#88 introduced @attachment instance variable in Carbon::Email, a named tuple with one of its members being an IO, which is not serializable.
Is it possible to get rid of the @attachment instance variable? Maybe redefine .attachment macro thus:
* Make emails serializable
Fixes <#91>.
* Ensure that an attachment cannot be added more than once to the same email
* Add back `attachments` argument to `.def_equals` call
I include
JSON::Serializable
in my emails to have them sent in the background with Mel. Since Carbon v0.5, I get a compile error:#88 introduced
@attachment
instance variable inCarbon::Email
, a named tuple with one of its members being anIO
, which is not serializable.Is it possible to get rid of the
@attachment
instance variable? Maybe redefine.attachment
macro thus:Code above is not tested, so I'm not sure if it works. But I'm thinking along the same lines as the callbacks:
carbon/src/carbon/callbacks.cr
Lines 24 to 34 in 0a814fd
Or is there a better way to handle emails with Mel that I'm missing?
The text was updated successfully, but these errors were encountered: