app/models/fields/custom_field.rb
def generate_column_name
    suffix = nil
    field_name = 'cf_' + label.downcase.gsub(/[^a-z0-9]+/, '_')
    while (final_name = [field_name, suffix].compact.join('_')) &&
          klass.column_names.include?(final_name)
      suffix = (suffix || 1) + 1
    end
    final_name
  end
# Generate column name for custom field.
# If column name is already taken, a numeric suffix is appended.
# Example column sequence: cf_custom, cf_custom_2, cf_custom_3, ...
#------------------------------------------------------------------------------
Generate column name for custom field.
If column name is already taken, a numeric suffix is appended.
Generate column name for custom field . If column name is already taken a numeric suffix is appended .
def generate_column_name
    suffix = nil
    field_name = 'cf_' + label.downcase.gsub(/[^a-z0-9]+/, '_')
    while (final_name = [field_name, suffix].compact.join('_')) &&
          klass.column_names.include?(final_name)
      suffix = (suffix || 1) + 1
    end
    final_name
  end
def generate_column_name suffix = nil field_name = 'cf_' + label . downcase . gsub ( / [^a-z0-9]+ / , '_' ) while ( final_name = [ field_name , suffix ] . compact . join ( '_' ) ) && klass . column_names . include? ( final_name ) suffix = ( suffix || 1 ) + 1 end final_name end
Generate column name for custom field.
Generate column name for custom field .