wco_models 3.1.0.92 → 3.1.0.94

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: 8acb70bd0285b4695c50cab2fa2c2338fa51dacb535df93fcfa805cd58e47f6f
4
- data.tar.gz: 0c1ce2b3a16a79982db08be8d129eced17acbf36cc246c6b095fbed813f14c43
3
+ metadata.gz: fdbf0222f27d2ad8ccf5fa71077e08fb9ec62eaf108e1e041ad29325740b6d99
4
+ data.tar.gz: 99a93f0cbb635bf0870da7cf9697373e25f7f5d176cdcee8a3ba812ebb7ece50
5
5
  SHA512:
6
- metadata.gz: efd8df489b52203a347f640a572433eb71f567de9454ac5de57d2949f08de48836d6dc394dd0bcc9ac025b7303004bb9575080618eebfc02d144f93d1efb871f
7
- data.tar.gz: 6bf11e6d4cf82022a4db7d1f07e7fb520bbe47d4a9e00c15bf31ecb73c5c7576f3c12a46c808912da35ea24002df622b72ae895028e2d72dc3912f9c790de06f
6
+ metadata.gz: 9dc5d6e0641b7c41b06a0c989405a9727a12b922c7bf58b5cb782157b8b8a3866b3d79ca3cdfd6971553b8a31cee36e1d81b28e0de1fb169c95b01da5113a456
7
+ data.tar.gz: 4d561105091521f34bca2f62f9da1eb38c0418b2b087748833c0066f2e699e7b310498ff8e806b0ba73db732c10a07a324710b01df649003316fcf1fc69ddad5
@@ -8,7 +8,7 @@ class Wco::LeadsController < Wco::ApplicationController
8
8
  params[:lead][:leadset] = nil if params[:lead][:leadset].blank?
9
9
 
10
10
  @lead = Wco::Lead.new params[:lead].permit!
11
- authorize! :crete, @lead
11
+ authorize! :create, @lead
12
12
  if @lead.save
13
13
  flash_notice 'ok'
14
14
  else
@@ -17,6 +17,11 @@ class Wco::LeadsController < Wco::ApplicationController
17
17
  redirect_to action: :index
18
18
  end
19
19
 
20
+ def edit
21
+ authorize! :edit, Wco::Lead
22
+ @lead = Wco::Lead.find params[:id]
23
+ end
24
+
20
25
  def index
21
26
  authorize! :index, Wco::Lead
22
27
  @leads = Wco::Lead.all
@@ -64,7 +69,17 @@ class Wco::LeadsController < Wco::ApplicationController
64
69
  end
65
70
 
66
71
  def update
67
- params[:tags].delete ''
72
+ params[:lead][:tags].delete ''
73
+ params[:lead][:leadset] = nil if params[:lead][:leadset].blank?
74
+
75
+ @lead = Wco::Lead.new params[:lead].permit!
76
+ authorize! :update, @lead
77
+ if @lead.save
78
+ flash_notice 'ok'
79
+ else
80
+ flash_alert @lead
81
+ end
82
+ redirect_to action: :show, id: @lead.id
68
83
  end
69
84
 
70
85
  ##
@@ -49,8 +49,9 @@ class WcoEmail::MessageStub
49
49
  })
50
50
  stub = self
51
51
 
52
- raw = @client.get_object( bucket: stub.bucket, key: stub.object_key ).body.read
53
- the_mail = Mail.new( raw )
52
+ raw = @client.get_object( bucket: stub.bucket, key: stub.object_key ).body.read
53
+ raw = raw.encode('utf-8', invalid: :replace, undef: :replace, replace: '_' )
54
+ the_mail = Mail.new( raw )
54
55
 
55
56
  message_id = the_mail.header['message-id']&.decoded
56
57
  message_id ||= "#{the_mail.date&.iso8601}::#{the_mail.from}"
@@ -19,7 +19,7 @@
19
19
 
20
20
  .field
21
21
  = f.label "Leadset (company)"
22
- = f.select :leadset, options_for_select(@leadsets_list, selected: lead.leadset_id), { class: :select2 }
22
+ = f.select :leadset, options_for_select(@leadsets_list, selected: lead.leadset_id), {}, { class: :select2 }
23
23
 
24
24
  -# .field
25
25
  -# %label Rating
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.92
4
+ version: 3.1.0.94
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev