35
36
37
38
39
40
41
42
43
44
|
# File 'lib/notification_hub/subscription_manager.rb', line 35
def create_subscription_device(association_model_id, device_id, event_code, channel_code)
subscription = NotificationHub::Subscription.
where("#{NotificationHub.association_model}_id" => association_model_id, event_code: event_code,
channel_code: channel_code).first_or_create!
subscription_device = NotificationHub::SubscriptionDevice.where(notification_hub_subscription_id:
subscription.id, notification_hub_device_id: device_id).first_or_create!
subscription_device
end
|