Sha256: a0f5c73558029739cadd6b58514bbbfb2541398b9b61bd53fe90ef20980f3d84

Contents?: true

Size: 631 Bytes

Versions: 42

Compression:

Stored size: 631 Bytes

Contents

module Locomotive
  module Concerns
    module ContentType
      module Label

        def label_field_id=(value)
          # update the label_field_name if the label_field_id is changed
          new_label_field_name = self.entries_custom_fields.where(_id: value).first.try(:name)
          self.label_field_name = new_label_field_name
          super(value)
        end

        def label_field_name=(value)
          # mandatory if we allow the API to set the label field name without an id of the field
          @new_label_field_name = value unless value.blank?
          super(value)
        end

      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
locomotivecms-4.2.0.alpha2 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-4.2.0.alpha1 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-4.1.1 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-4.1.0 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-4.1.0.rc1 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-4.0.3 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-4.0.2 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-4.0.1 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-4.0.0 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-4.0.0.rc0 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-4.0.0.alpha3 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-3.4.1 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-4.0.0.alpha2 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-4.0.0.alpha1 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-3.4.0 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-3.3.0 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-3.3.0.rc3 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-3.3.0.rc2 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-3.1.2 app/models/locomotive/concerns/content_type/label.rb
locomotivecms-3.2.1 app/models/locomotive/concerns/content_type/label.rb