Sha256: 9c998957b1c0685e5ad00a8e9c45a46c13f8babca82706fe323b6a4705f6adcc

Contents?: true

Size: 334 Bytes

Versions: 19

Compression:

Stored size: 334 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.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

19 entries across 19 versions & 1 rubygems

Version Path
avo-1.6.4.pre.1 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.6.3.pre.2 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.6.3.pre.1 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.6.2.pre.1 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.6.1 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.6.0 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.5.5 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.5.4 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.5.3 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.5.2 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.5.1 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.5.0 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.4.5.pre.1 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.4.4.pre.1 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.4.4 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.4.3 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.4.2 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.4.1 app/components/avo/fields/belongs_to_field/edit_component.rb
avo-1.4.0 app/components/avo/fields/belongs_to_field/edit_component.rb