Sha256: 3ccfa2f22f1c351c419bd6a2080097c873ba07c70ccc244c05fbf7dda56ec777

Contents?: true

Size: 571 Bytes

Versions: 3

Compression:

Stored size: 571 Bytes

Contents

# frozen_string_literal: true

module Tramway::ExtendableFormsHelpers::Submit::ObjectHelpers
  def extended(simple_properties, more_properties, params)
    params.except(*simple_properties.keys).except(*jsonb_ignored_properties(more_properties)).permit!.to_h
  end

  def every_attribute_set(params)
    params.each do |key, value|
      method_name = "#{key}="
      send(method_name, value) if respond_to?(method_name)
    end
  end

  def save_in_submit(_params)
    result = save
    result.tap do
      collecting_associations_errors unless result
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tramway-0.1.2 app/forms/tramway/extendable_forms_helpers/submit/object_helpers.rb
tramway-0.1.1.1 app/forms/tramway/extendable_forms_helpers/submit/object_helpers.rb
tramway-0.1.1 app/forms/tramway/extendable_forms_helpers/submit/object_helpers.rb