Sha256: 0f55642350b8b6127a4e632f773427b81dc96b4a03a44cfc079ee68e0755c081

Contents?: true

Size: 582 Bytes

Versions: 3

Compression:

Stored size: 582 Bytes

Contents

# frozen_string_literal: true

module Plutonium
  module UI
    module Form
      module Components
        class HasMany < Phlexi::Form::Components::HasMany
          include Plutonium::UI::Component::Methods

          private

          def choices
            @choices ||= begin
              collection = authorized_resource_scope(association_reflection.klass, relation: @choice_collection)
              Phlexi::Form::ChoicesMapper.new(collection, label_method: @label_method, value_method: @value_method)
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
plutonium-0.16.3 lib/plutonium/ui/form/components/has_many.rb
plutonium-0.16.1 lib/plutonium/ui/form/components/has_many.rb
plutonium-0.16.0 lib/plutonium/ui/form/components/has_many.rb