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 +4 -4
- data/Gemfile.lock +1 -1
- data/app/controllers/avo/application_controller.rb +11 -13
- data/app/controllers/avo/base_controller.rb +0 -2
- data/lib/avo/fields/key_value_field.rb +4 -4
- data/lib/avo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a674dcf4fc813cc44eb1338ee81a79cf18f4e32fa43c3043fd9b379e90e0287d
|
4
|
+
data.tar.gz: aa4d972f61fc521cbd3aba2c1130f2d5488c542f6b96f55e125a45cd678790d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15c38ab033891c33e2051f002f6aba6646b775f760e8e1457db83c5eb3abd95c37f75ec6a3352d6cda8f4d660c765f480ae9c33b65634c320d551a06b5bd8084
|
7
|
+
data.tar.gz: 3279dad375d248984016e9cc91c55d8c8338d1404ee0e89177df15d2d8e782147a2e7c29e3a41b79a3a84afcf87cb08a255c2084f048819c535e833b20c60ec7
|
data/Gemfile.lock
CHANGED
@@ -111,7 +111,13 @@ module Avo
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def fill_model
|
114
|
-
|
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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
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