Skip to content

Loading…

Mailer compatibility with Devise 2.2.0 #261

Merged
merged 2 commits into from

2 participants

@tmikoss

plataformatec/devise@19b5bcb
efea382d45cc1d7 changes mailer method signature in Devise side

@tmikoss

I will look into the failed build later today, but at a glance it does not seem to be caused by my changes :/

Maybe some other incompatibility with 2.2.0?

@scambra scambra merged commit ee5aac0 into scambra:master

1 check failed

Details default The Travis build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 9, 2013
  1. @tmikoss

    Change method signature of invitation_instructions mailer

    tmikoss committed
    plataformatec/devise@19b5bcb
    efea382d45cc1d7 changes the signature in Devise side
  2. @tmikoss
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/devise_invitable/mailer.rb
View
11 lib/devise_invitable/mailer.rb
@@ -1,9 +1,16 @@
+require 'devise/version'
+
module DeviseInvitable
module Mailer
# Deliver an invitation email
- def invitation_instructions(record)
- devise_mail(record, :invitation_instructions)
+ def invitation_instructions(record, opts={})
+ # optional arguments introduced in Devise 2.2.0, remove check once support for < 2.2.0 is dropped.
+ if Gem::Version.new(Devise::VERSION.dup) < Gem::Version.new('2.2.0')
+ devise_mail(record, :invitation_instructions)
+ else
+ devise_mail(record, :invitation_instructions, opts)
+ end
end
end
end
Something went wrong with that request. Please try again.