Sha256: ad68711dbda3c80f3999184359971a073f1be5b1ea436f8bc2a116854a444b70

Contents?: true

Size: 369 Bytes

Versions: 68

Compression:

Stored size: 369 Bytes

Contents

# frozen_string_literal: true

class Avo::Fields::BelongsToField::EditComponent < Avo::Fields::EditComponent
  def disabled
    return true if @field.readonly
    return true if @field.target_resource.present? && @field.target_resource.model_class.name == params[:via_resource_class]
    return true if @field.id.to_s == params[:via_relation].to_s

    false
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
avo-1.21.1.pre.1 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.21.0 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.20.2.pre.2 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.20.2.pre.1 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.21.0.pre.1 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.20.1 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.19.1.pre.11 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.19.1.pre.10 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.19.1.pre.9 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.19.1.pre.8 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.19.1.pre.7 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.19.1.pre.6 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.19.1.pre.5 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.19.1.pre.4 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.19.1.pre.3 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.19.1.pre.2 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.19.1.pre.1 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.19.0 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.18.2 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.18.2.pre.0 app/components/avo/fields/belongs_to_field/edit_component.rb