caffeinate 2.6.0 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80b37c2c81ad72352314b1515575b4b5d91c78356d8d534075eff1a9bc161881
4
- data.tar.gz: de05a62c92be2eec505bf3beabda4488f4a8292c12285745c4eb34c880b8ac1a
3
+ metadata.gz: 768001daf3c0272130745b6749648d136118f4c8a24c2e1b4bca19e77d2883b6
4
+ data.tar.gz: ae9c61c07b543ec15fd3b6e7c7ea09ccdc199c52c54e37f83fc2894717725776
5
5
  SHA512:
6
- metadata.gz: 2bca9ae1ca715af5abdedb012610a6ff397fbe109176798fcc87e8de8e9b1f24e1282d525289baad168be41c11c8401eca740b09430f843cdeacdb07aefff439
7
- data.tar.gz: 5fb91cdf1517ffe52c1cd474ddb53dbf2b912fd49975307697ff6ed43bc7660da2946feb770e2cb6cb5ce49615dee5bce2bd7b10b68a90dd5781ef53fb20ef75
6
+ metadata.gz: 6311c1a5b9d62542770f7551eff109b7b3f50d6075c8df0462ada136b0f60048da667dcbdf3703a5d847edb5abd0db8ae37cdf38f847ddeb1609d999798dd17f
7
+ data.tar.gz: 943a81a8b7f2a3cefbc4862a8da7c031b00426ec0f4e271eecb0e74b72a6d48e896a3ee9dbb98f64e2363be37a5df7dd57bb8c6f3e2f9f7770e34a25d8127e3e
data/README.md CHANGED
@@ -229,7 +229,7 @@ a `Caffeinate::CampaignSubscription`.
229
229
  ```ruby
230
230
  class User < ApplicationRecord
231
231
  after_commit on: :create do
232
- OnboardingDripper.subscribe!(self)
232
+ OnboardingDripper.subscribe(self)
233
233
  end
234
234
  end
235
235
  ```
@@ -8,8 +8,12 @@ module Caffeinate
8
8
 
9
9
  before_action :find_campaign_subscription!
10
10
 
11
+ skip_before_action :verify_authenticity_token, only: [:unsubscribe], if: -> { request.post? }
12
+
11
13
  def unsubscribe
12
14
  @campaign_subscription.unsubscribe!(true)
15
+
16
+ head :ok if request.post?
13
17
  end
14
18
 
15
19
  def subscribe
data/config/routes.rb CHANGED
@@ -3,8 +3,9 @@
3
3
  Caffeinate::Engine.routes.draw do
4
4
  resources :campaign_subscriptions, only: [], param: :token do
5
5
  member do
6
- get :unsubscribe
7
6
  get :subscribe
7
+ get :unsubscribe
8
+ post :unsubscribe
8
9
  end
9
10
  end
10
11
  end
@@ -12,7 +12,8 @@ module Mail
12
12
  def caffeinate_mailing=(mailing)
13
13
  @caffeinate_mailing = mailing
14
14
  if mailing.is_a?(::Caffeinate::Mailing)
15
- header['List-Unsubscribe'] = "<#{Caffeinate::UrlHelpers.caffeinate_subscribe_url(mailing.subscription)}>"
15
+ header['List-Unsubscribe'] = "<#{Caffeinate::UrlHelpers.caffeinate_unsubscribe_url(mailing.subscription)}>"
16
+ header['List-Unsubscribe-Post'] = 'List-Unsubscribe=One-Click'
16
17
  end
17
18
  end
18
19
 
@@ -1,3 +1,3 @@
1
1
  module Caffeinate
2
- VERSION = "2.6.0"
2
+ VERSION = "2.6.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caffeinate
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Brody