Sha256: 5c1da07ca23aec76f10349ea3d9242d251d96beac3819db441561b8e03ccb141

Contents?: true

Size: 504 Bytes

Versions: 2

Compression:

Stored size: 504 Bytes

Contents

# frozen_string_literal: true

module Phlexi
  module Form
    module Components
      class HasMany < Select
        protected

        delegate :association_reflection, to: :field

        def build_attributes
          build_has_many_attributes
          super
        end

        def build_has_many_attributes
          attributes.fetch(:input_param) {
            attributes[:input_param] = :"#{association_reflection.name.to_s.singularize}_ids"
          }
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
phlexi-form-0.7.0 lib/phlexi/form/components/has_many.rb
phlexi-form-0.6.2 lib/phlexi/form/components/has_many.rb