lib/mailkick/model.rb in mailkick-1.3.0 vs lib/mailkick/model.rb in mailkick-1.3.1

- old
+ new

@@ -1,10 +1,10 @@ module Mailkick module Model def has_subscriptions class_eval do has_many :mailkick_subscriptions, class_name: "Mailkick::Subscription", as: :subscriber - scope :subscribed, -> (list) { joins(:mailkick_subscriptions).where(mailkick_subscriptions: {list: list}) } + scope :subscribed, ->(list) { joins(:mailkick_subscriptions).where(mailkick_subscriptions: {list: list}) } def subscribe(list) mailkick_subscriptions.where(list: list).first_or_create! nil end