Skip to content

Commit

Permalink
key not required
Browse files Browse the repository at this point in the history
  • Loading branch information
apricot13 committed Nov 12, 2024
1 parent 8603281 commit e0c5428
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/custom_field.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CustomField < ApplicationRecord
before_validation :slugify_key

validates :key, uniqueness: true, format: { with: /\A[a-z0-9\-]+\z/, message: "must be lowercase, numbers, and dashes only" }
validates :key, uniqueness: { allow_blank: true }, format: { with: /\A[a-z0-9\-]+\z/, message: "must be lowercase, numbers, and dashes only", allow_blank: true }
validates :label, presence: true, uniqueness: true
validates_presence_of :field_type
belongs_to :custom_field_section, counter_cache: :custom_fields_count
Expand Down

0 comments on commit e0c5428

Please sign in to comment.