wco_models 3.1.0.92 → 3.1.0.93

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: 2ce69cb552cc8f072d6cab730355f2680f5080773b5ba38f15cb45827c1d69ce
4
+ data.tar.gz: df88159670a5a92bade97d647c652bbd11b5d8e7a7d630b8ff4837fd878fc8d5
5
5
  SHA512:
6
- metadata.gz: efd8df489b52203a347f640a572433eb71f567de9454ac5de57d2949f08de48836d6dc394dd0bcc9ac025b7303004bb9575080618eebfc02d144f93d1efb871f
7
- data.tar.gz: 6bf11e6d4cf82022a4db7d1f07e7fb520bbe47d4a9e00c15bf31ecb73c5c7576f3c12a46c808912da35ea24002df622b72ae895028e2d72dc3912f9c790de06f
6
+ metadata.gz: 0cccea65fbae4e19a976408913ae73f9fe602019ae1ed4d1314a61b6ea3bb2a1c70333b9eb84ff39152f0a8d361c730d9922c77bdb7b60a07670f9be9ce6c282
7
+ data.tar.gz: 89592dfbb1197a866983d79573cae2d61109cf7d635a06e4b9609edb0e615108d3f8f1f2181934fdadb8ff90f11a7bc33160e35306127e111798361160c22dc0
@@ -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
  ##
@@ -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.93
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev