avo 1.20.2.pre.1 → 1.20.2.pre.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of avo might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1637660ec39f73cf35fe0078d721b17ab5a2aded94fdbf633ce3b63c326c55a0
4
- data.tar.gz: c990f246d271819abe2f098ecea83bb6b367cad93e6fc0cc0994d54c08e8dc64
3
+ metadata.gz: a674dcf4fc813cc44eb1338ee81a79cf18f4e32fa43c3043fd9b379e90e0287d
4
+ data.tar.gz: aa4d972f61fc521cbd3aba2c1130f2d5488c542f6b96f55e125a45cd678790d4
5
5
  SHA512:
6
- metadata.gz: 18fb3a1ee203bc93a1863e8138c3a7f7fac5faf4775e92fc7208fce652b1420e8efe9df28482ac30626b2095ebb4981aafaa9d8153fee6a1b5b09a0e30c8eb84
7
- data.tar.gz: b74310670a84f49c7ba06847e018c9c41542f08376e95650126b74818aeb3fd73acf151647450ba69676e876e517a2a88986ae4d12b2336f027353f4841f7ba8
6
+ metadata.gz: 15c38ab033891c33e2051f002f6aba6646b775f760e8e1457db83c5eb3abd95c37f75ec6a3352d6cda8f4d660c765f480ae9c33b65634c320d551a06b5bd8084
7
+ data.tar.gz: 3279dad375d248984016e9cc91c55d8c8338d1404ee0e89177df15d2d8e782147a2e7c29e3a41b79a3a84afcf87cb08a255c2084f048819c535e833b20c60ec7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (1.20.2.pre.1)
4
+ avo (1.20.2.pre.2)
5
5
  active_link_to
6
6
  addressable
7
7
  breadcrumbs_on_rails
@@ -111,7 +111,13 @@ module Avo
111
111
  end
112
112
 
113
113
  def fill_model
114
- @model = @resource.fill_model(@model_to_fill, cast_nullable(model_params))
114
+ # We have to skip filling the the model if this is an attach action
115
+ is_attach_action = params[model_param_key].blank? && params[:related_name].present? && params[:fields].present?
116
+ # puts ['fill_model->', is_attach_action, model_param_key].inspect
117
+
118
+ unless is_attach_action
119
+ @model = @resource.fill_model(@model_to_fill, cast_nullable(model_params))
120
+ end
115
121
  end
116
122
 
117
123
  def hydrate_resource
@@ -187,18 +193,6 @@ module Avo
187
193
  query
188
194
  end
189
195
 
190
- # def authorize_user
191
- # return if params[:controller] == 'avo/search'
192
-
193
- # model = record = resource.model
194
-
195
- # if ['show', 'edit', 'update'].include?(params[:action]) && params[:controller] == 'avo/resources'
196
- # record = resource
197
- # end
198
-
199
- # # AuthorizationService::authorize_action _current_user, record, params[:action] return render_unauthorized unless
200
- # end
201
-
202
196
  def _authenticate!
203
197
  instance_eval(&Avo.configuration.authenticate)
204
198
  end
@@ -243,5 +237,9 @@ module Avo
243
237
  def on_api_path
244
238
  request.original_url.match?(/.*#{Avo::App.root_path}\/avo_api\/.*/)
245
239
  end
240
+
241
+ def model_param_key
242
+ @resource.form_scope
243
+ end
246
244
  end
247
245
  end
@@ -193,8 +193,6 @@ module Avo
193
193
  private
194
194
 
195
195
  def model_params
196
- model_param_key = @resource.form_scope
197
-
198
196
  request_params = params.require(model_param_key).permit(permitted_params)
199
197
 
200
198
  if @resource.devise_password_optional && request_params[:password].blank? && request_params[:password_confirmation].blank?
@@ -44,10 +44,10 @@ module Avo
44
44
 
45
45
  def options
46
46
  {
47
- # key_label: @key_label,
48
- # value_label: @value_label,
49
- # action_text: @action_text,
50
- # delete_text: @delete_text,
47
+ key_label: @key_label,
48
+ value_label: @value_label,
49
+ action_text: @action_text,
50
+ delete_text: @delete_text,
51
51
  disable_editing_keys: @disable_editing_keys,
52
52
  disable_adding_rows: @disable_adding_rows,
53
53
  disable_deleting_rows: @disable_deleting_rows
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "1.20.2.pre.1"
2
+ VERSION = "1.20.2.pre.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.2.pre.1
4
+ version: 1.20.2.pre.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin