Sha256: af86c0da2e786979b18bd5d50bdf9069a12ed20c424fa4f00c261420d872a7c5

Contents?: true

Size: 1.34 KB

Versions: 34

Compression:

Stored size: 1.34 KB

Contents

api.array :custom_fields do
  @custom_fields.each do |field|
    api.custom_field do
      api.id                field.id
      api.name              field.name
      api.customized_type   field.class.customized_class.name.underscore if field.class.customized_class
      api.field_format      field.field_format
      api.regexp            field.regexp
      api.min_length        field.min_length
      api.max_length        field.max_length
      api.is_required       field.is_required?
      api.is_filter         field.is_filter?
      api.searchable        field.searchable
      api.multiple          field.multiple?
      api.default_value     field.default_value
      api.visible           field.visible?

      values = field.possible_values_options
      if values.present?
        api.array :possible_values do
          values.each do |label, value|
            api.possible_value do
              api.value value || label
            end
          end
        end
      end

      if field.is_a?(IssueCustomField)
        api.array :trackers do
          field.trackers.each do |tracker|
            api.tracker :id => tracker.id, :name => tracker.name
          end
        end
        api.array :roles do
          field.roles.each do |role|
            api.role :id => role.id, :name => role.name
          end
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
redmine_extensions-0.0.39 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.0.38 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.0.37 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.1.11 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.1.10 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.0.36 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.0.34 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.1.09 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.1.07 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.1.06 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.1.05 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.1.04 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.1.03 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.0.33 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.1.02 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.1.01 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.0.29 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.0.28 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.0.27 spec/redmine/app/views/custom_fields/index.api.rsb
redmine_extensions-0.0.24 spec/redmine/app/views/custom_fields/index.api.rsb