Skip to content

It should be possible to iteratively add recipients to an email #14

Description

@esquivalient
(rdbg) itme.recipients << "tony@expectedbehavior.com"    # ruby
eval error: EmailUser(#17760) expected, got "tony@expectedbehavior.com" which is an instance of String(#3440)
  /Users/esquivalient/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/associations/association.rb:299:in `raise_on_type_mismatch!'
  /Users/esquivalient/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/associations/has_many_through_association.rb:17:in `block in concat'
  /Users/esquivalient/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/associations/has_many_through_association.rb:16:in `each'
  /Users/esquivalient/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/associations/has_many_through_association.rb:16:in `concat'
  /Users/esquivalient/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/associations/collection_proxy.rb:1032:in `<<'
  (rdbg)//Users/esquivalient/Dropbox/code/burndown/test/models/invite_team_member_email_test.rb:1:in `block in <class:InviteTeamMemberEmailTest>'
nil

doesn't work, but

(rdbg) itme.recipients = ["tony@expectedbehavior.com"]    # ruby
[#<ActiveMailer::EmailUser:0x000000010efb6558
  id: 9,
  email_address: "tony@expectedbehavior.com",
  created_at: Thu, 04 Aug 2022 19:34:23.486894000 UTC +00:00,
  updated_at: Thu, 04 Aug 2022 19:34:23.486894000 UTC +00:00>]
(rdbg)

does. That's a needless paper cut.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions