-
Notifications
You must be signed in to change notification settings - Fork 73
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
Undefined method before_deliver
when included
#56
Comments
Same error and fix here. Thanks for the tip. |
+1 Same error, same fix: class SupportMail < ApplicationRecord
include MailForm::Shim
include MailForm::Delivery
end |
Same error, but including |
Question posted at Stackoverflow |
including MailForm::Shim gives this error: undefined method `[]' for nil:NilClass |
I have the same problem as t3k4y , did you find a solution? |
same problem, any update on this ? |
It seems that
before you
|
mail_form is broken if you try to use it with ActiveRecord, which used to work before Rails 5.1. The culprit is this code fragment in
It used to add a My solution is to add the method and
|
@mkolodziej appreciate you sharing this snippet! I just pushed a fix for this AR integration in MailForm, it's been broken for quite a while 😅. I'll look into pushing a new version in the next few days, just want to wrap up a few other things here. In the meantime, if anyone here wants to try out master, please let me know how that worked. |
Hi there -
Following the instructions on the readme, I added
include MailForm::Delivery
on an existing class I had. I then receivedundefined method `before_deliver'
when running my tests. I eventually solved it by also addinginclude MailForm::Shim
. I'm not sure if that's the "right" way to do it, but I figured I'd post here in case 1: Someone else has this issue; 2: It's the wrong way and you can correct me; or 3: It can be added to the READMEThe text was updated successfully, but these errors were encountered: