herdst_worker 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3254fcd594ea3a211d269c900505e43a94e009853539a8d2617199e5e6462f81
4
- data.tar.gz: 6068fb649532ade81c2efa971d6b4cb047cb72c1ed3520dff2d8d8c9fdf8fd8f
3
+ metadata.gz: f923f35476bb893010b8dfe3fd0ecd8d60cfe599d21b187d1ef2c615e721a8c0
4
+ data.tar.gz: db24d82e075659d3cdb955e184f0504d44769f615341c53e33a8140ea022ed3d
5
5
  SHA512:
6
- metadata.gz: b52253de870c4690ef7d711cbce8c76b5e9530790fc333ab2d93aeb5d563b1686498b2b9793d8fe4e58ffd99608195279c4df791c5377746c3653d84101c5837
7
- data.tar.gz: 11cfac61c8bde4b86d1f93afebba9345de79c67f9d3e47309d4e129cd816c5de0dd85b3f167ec5e390a0976b0729c87b9cac17efd67b14f2305e39f526903a1c
6
+ metadata.gz: 94aaf2d09122cdb0eb8b386cb91f3207d7cbb1a98dfc7ad3bbfecbcdedbded460162c73fd4d83daae306d885de83be76c517eb2efc27b0109c0c04302cf7cf12
7
+ data.tar.gz: 4c1a7e468c82f9467eb6a57d020d5e64057185b15399ab8c8debae202eca047d2fd7fcae5ebed9da67a4a277ffb513ce6de8d6cd0eb9581c76040b9f40fd6a07
@@ -92,6 +92,8 @@ module HerdstWorker
92
92
 
93
93
 
94
94
  def create_email_queue_message(template, company, message_data, attributes = nil, delay = 2)
95
+ company_key = company.class.name.downcase.to_sym
96
+
95
97
  # Convert instances of ApplicationRecord to attributes instead of json representation
96
98
  message_data.each do |key, value|
97
99
  message_data[key] = value.attributes if value.is_a?(ActiveRecord::Base)
@@ -108,8 +110,8 @@ module HerdstWorker
108
110
  data[:type] = "email"
109
111
  data[:template] = template
110
112
  data[:data] = message_data || {}
111
- data[:data][:company] = company unless data[:data][:company].present?
112
-
113
+ data[:data][company_key] = company unless data[:data][company_key].present?
114
+
113
115
  # Add message structure
114
116
  message = Hash.new
115
117
  message[:id] = SecureRandom.hex(32)
@@ -1,3 +1,3 @@
1
1
  module HerdstWorker
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herdst_worker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Herd.St
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-05 00:00:00.000000000 Z
11
+ date: 2023-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport