Sha256: 4e0f217648b1497a6df10e31536d88a96f132e55e8d66a0729f37998f915a889
Contents?: true
Size: 430 Bytes
Versions: 26
Compression:
Stored size: 430 Bytes
Contents
module Spree module NumberIdentifier extend ActiveSupport::Concern included do before_validation :uppercase_number validates :number, presence: true, length: { maximum: 32, allow_blank: true }, uniqueness: { allow_blank: true, case_sensitive: true, scope: spree_base_uniqueness_scope } end protected def uppercase_number number&.to_s&.upcase! end end end
Version data entries
26 entries across 26 versions & 1 rubygems