From cdb2462484a837ce526542a5d98de30bbcaeed55 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 26 Jun 2023 20:28:44 +0300 Subject: [PATCH] wip --- lib/avo/fields/base_field.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/avo/fields/base_field.rb b/lib/avo/fields/base_field.rb index 2e351d05e2..a6a6a68fb1 100644 --- a/lib/avo/fields/base_field.rb +++ b/lib/avo/fields/base_field.rb @@ -70,6 +70,7 @@ def initialize(id, **args, &block) @nullable = args[:nullable] || false @null_values = args[:null_values] || [nil, ""] @format_using = args[:format_using] || nil + @update_using = args[:update_using] || nil @placeholder = args[:placeholder] @autocomplete = args[:autocomplete] || nil @help = args[:help] || nil @@ -83,8 +84,6 @@ def initialize(id, **args, &block) @view = args[:view] || nil @value = args[:value] || nil @stacked = args[:stacked] || nil - @update_as = args[:update_as] || nil - @format_as = args[:format_as] || nil @resource = args[:resource] @args = args @@ -206,8 +205,8 @@ def fill_field(model, key, value, params) model end - def update_as(model, key, value, params) - Avo::ExecutionContext.new(target: @update_as, model: model, key: key, value: value, resource: resource, field: self).handle + def update_using(model, key, value, params) + Avo::ExecutionContext.new(target: @update_using, model: model, key: key, value: value, resource: resource, field: self).handle end # Try to see if the field has a different database ID than it's name