lib/avo/base_action.rb in avo-3.0.0.pre13 vs lib/avo/base_action.rb in avo-3.0.0.pre14
- old
+ new
@@ -99,16 +99,19 @@
def handle_action(**args)
records, fields, current_user, resource = args.values_at(:records, :fields, :current_user, :resource)
# Fetching the field definitions and not the actual fields (get_fields) because they will break if the user uses a `visible` block and adds a condition using the `params` variable. The params are different in the show method and the handle method.
action_fields = get_field_definitions.map { |field| [field.id, field] }.to_h
+ puts ["action_fields->", action_fields].inspect
# For some fields, like belongs_to, the id and database_id differ (user vs user_id).
# That's why we need to fetch the database_id for when we process the action.
action_fields_by_database_id = action_fields.map do |id, value|
[value.database_id.to_sym, value]
end.to_h
+ puts ["action_fields_by_database_id->", action_fields_by_database_id].inspect
+ abort 1.inspect
if fields.present?
processed_fields = fields.to_unsafe_h.map do |name, value|
field = action_fields_by_database_id[name.to_sym]
@@ -126,10 +129,10 @@
fields: processed_fields.with_indifferent_access,
current_user: current_user,
resource: resource
}
- args[:records] = records unless standalone
+ args[:records] = records
handle(**args)
self
end