class Para::AttributeField::FriendlyId

Public Instance Methods

parse_input(params, resource) click to toggle source

Set empty string as nil to allow default friendly id methods to generate the slug when the field is empty

# File lib/para/attribute_field/friendly_id.rb, line 8
def parse_input(params, resource)
  params[slug_column] = nil if slug_column && params[slug_column] == ''
end

Private Instance Methods

slug_column() click to toggle source
# File lib/para/attribute_field/friendly_id.rb, line 14
def slug_column
  model.try(:friendly_id_config).try(:slug_column)
end