jkraemer / mail-gpg

GPG/MIME extension for the Ruby Mail Library
MIT License
69 stars 24 forks source link

Rails 4.2 -> 5.0 -> 5.1 deprecation warnings #34

Closed ignisf closed 7 years ago

ignisf commented 8 years ago

Hello,

I'm working on updating an app that relies on mail-gpg to Rails 5.

The following deprecation warnings crop up when running the tests with Rails 4.2:

DEPRECATION WARNING: `#deliver` is deprecated and will be removed in Rails 5. Use `#deliver_now` to deliver immediately or `#deliver_later` to deliver through Active Job. (called from block (3 levels) in <class:ActionMailerTest> at /home/travis/build/jkraemer/mail-gpg/test/action_mailer_test.rb:97)
DEPRECATION WARNING: `#deliver` is deprecated and will be removed in Rails 5. Use `#deliver_now` to deliver immediately or `#deliver_later` to deliver through Active Job. (called from block (3 levels) in <class:ActionMailerTest> at /home/travis/build/jkraemer/mail-gpg/test/action_mailer_test.rb:112)
DEPRECATION WARNING: `#deliver` is deprecated and will be removed in Rails 5. Use `#deliver_now` to deliver immediately or `#deliver_later` to deliver through Active Job. (called from block (3 levels) in <class:ActionMailerTest> at /home/travis/build/jkraemer/mail-gpg/test/action_mailer_test.rb:87)
DEPRECATION WARNING: `#deliver` is deprecated and will be removed in Rails 5. Use `#deliver_now` to deliver immediately or `#deliver_later` to deliver through Active Job. (called from block (3 levels) in <class:ActionMailerTest> at /home/travis/build/jkraemer/mail-gpg/test/action_mailer_test.rb:52)
DEPRECATION WARNING: `#deliver` is deprecated and will be removed in Rails 5. Use `#deliver_now` to deliver immediately or `#deliver_later` to deliver through Active Job. (called from block (3 levels) in <class:ActionMailerTest> at /home/travis/build/jkraemer/mail-gpg/test/action_mailer_test.rb:66)
DEPRECATION WARNING: `#deliver` is deprecated and will be removed in Rails 5. Use `#deliver_now` to deliver immediately or `#deliver_later` to deliver through Active Job. (called from block (3 levels) in <class:ActionMailerTest> at /home/travis/build/jkraemer/mail-gpg/test/action_mailer_test.rb:42)

And these are raised when running them with Rails 5:

DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from block in <module:ActionMailerPatch> at /home/travis/build/jkraemer/mail-gpg/lib/mail/gpg/rails/action_mailer_base_patch.rb:11)
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from singleton class at /home/travis/build/jkraemer/mail-gpg/lib/mail/gpg/rails/action_mailer_base_patch.rb:13)

Considering the Rails maintenance policy do you think that dropping support for Rails < 4.2 is feasible? I don't like the idea of adding logic that checks current Rails version to handle these deprecations.

jkraemer commented 8 years ago

I fixed the alias_method_chain stuff. To me it looks like the deliver warnings all stem from using #deliver in the test case, not from the library code. Therefore I would be fine to have a Rails version check in there or wait until it really breaks with a released version of Rails (which doesn't seem to be the case until now). What do you think?

ignisf commented 8 years ago

Hi! I'm glad you're back! 😁

Yes, having in mind that in Rails 5 the #deliver warnings are gone, it might be OK to just leave it as is.