Sha256: 31edb34d57391bbb0ec576875da837f760b6e417d378e08f6302dd015e742977

Contents?: true

Size: 357 Bytes

Versions: 5

Compression:

Stored size: 357 Bytes

Contents

# frozen_string_literal: true

class SolidusAdmin::UI::Forms::Address::Component < SolidusAdmin::BaseComponent
  def initialize(address:, name:, disabled: false)
    @address = address
    @name = name
    @disabled = disabled
  end

  def state_options
    return [] unless @address.country
    @address.country.states.map { |s| [s.name, s.id] }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_admin-0.3.2 app/components/solidus_admin/ui/forms/address/component.rb
solidus_admin-0.3.1 app/components/solidus_admin/ui/forms/address/component.rb
solidus_admin-0.3.0 app/components/solidus_admin/ui/forms/address/component.rb
solidus_admin-0.2.0 app/components/solidus_admin/ui/forms/address/component.rb
solidus_admin-0.1.0 app/components/solidus_admin/ui/forms/address/component.rb