Sha256: 8862573ad80fcbe96cae84784cf38784d4284b2731610d1e8585be77a8e86399

Contents?: true

Size: 705 Bytes

Versions: 28

Compression:

Stored size: 705 Bytes

Contents

module Scrivito
  class ObjUpdateParamsParser < ObjParamsParser
    private

    def obj
      context[:current_obj]
    end

    def convert_params(params)
      convert_field_params(params, obj.attribute_definitions)
      convert_widget_pool_params(params)
    end

    def convert_widget_pool_params(params)
      return unless params['_widget_pool']

      widget_pool = {}
      params['_widget_pool'].each_pair do |widget_id, widget_params|
        if widget_params.present?
          widget = obj.widgets[widget_id]
          widget_pool[widget] = convert_field_params(widget_params, widget.attribute_definitions)
        end
      end
      params['_widget_pool'] = widget_pool
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
scrivito_sdk-0.66.0 lib/scrivito/obj_update_params_parser.rb
scrivito_sdk-0.66.0.rc2 lib/scrivito/obj_update_params_parser.rb
scrivito_sdk-0.65.2 lib/scrivito/obj_update_params_parser.rb
scrivito_sdk-0.66.0.rc1 lib/scrivito/obj_update_params_parser.rb
scrivito_sdk-0.65.1 lib/scrivito/obj_update_params_parser.rb
scrivito_sdk-0.65.0 lib/scrivito/obj_update_params_parser.rb
scrivito_sdk-0.65.0.rc2 lib/scrivito/obj_update_params_parser.rb
scrivito_sdk-0.65.0.rc1 lib/scrivito/obj_update_params_parser.rb