Sha256: 0965ce20b97297e42bd856bd72d62edb3048eb92dddf4a14c28011bfd662025c

Contents?: true

Size: 586 Bytes

Versions: 3

Compression:

Stored size: 586 Bytes

Contents

# frozen_string_literal: true

module Plutonium
  module UI
    module Form
      module Components
        class BelongsTo < Phlexi::Form::Components::BelongsTo
          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/belongs_to.rb
plutonium-0.16.1 lib/plutonium/ui/form/components/belongs_to.rb
plutonium-0.16.0 lib/plutonium/ui/form/components/belongs_to.rb