Commit 36e5806e by yuzixun

add with indifferent access

parent 540a25dc
...@@ -11,11 +11,15 @@ class NotificationStatistic < ApplicationRecord ...@@ -11,11 +11,15 @@ class NotificationStatistic < ApplicationRecord
enum app_type: %i[ik_duli lx_duli lx_yun aike_yun] enum app_type: %i[ik_duli lx_duli lx_yun aike_yun]
def self.create_by_params(igetui_opts, message, device_ids_opts, app_type) def self.create_by_params(igetui_opts, message, device_ids_opts, app_type)
igetui_opts = igetui_opts.with_indifferent_access
message = message.with_indifferent_access
device_ids_opts = device_ids_opts.with_indifferent_access
device_ids_opts.each do |platform, client_ids| device_ids_opts.each do |platform, client_ids|
client_ids.each do |client_id| client_ids.each do |client_id|
NotificationStatistic.create( NotificationStatistic.create(
organization_id: igetui_opts[:organization_id], organization_id: igetui_opts[:organization_id],
user_id: igetui_opts[:user_id], user_id: message[:user_id],
notification_id: message[:id], notification_id: message[:id],
client_id: client_id, client_id: client_id,
platform: platform, platform: platform,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment