Sha256: bffaebdba53f5f010659730c50bc3cb4bae6e49af123bc79f1e8e9165500cddf

Contents?: true

Size: 286 Bytes

Versions: 9

Compression:

Stored size: 286 Bytes

Contents

module Spree
  module NamedType
    extend ActiveSupport::Concern

    included do
      scope :active, -> { where(active: true) }
      default_scope { order("LOWER(#{table_name}.name)") }

      validates :name, presence: true, uniqueness: { case_sensitive: false }
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spree_core-3.4.6 app/models/concerns/spree/named_type.rb
spree_core-3.4.5 app/models/concerns/spree/named_type.rb
spree_core-3.4.4 app/models/concerns/spree/named_type.rb
spree_core-3.4.3 app/models/concerns/spree/named_type.rb
spree_core-3.4.2 app/models/concerns/spree/named_type.rb
spree_core-3.4.1 app/models/concerns/spree/named_type.rb
spree_core-3.4.0 app/models/concerns/spree/named_type.rb
spree_core-3.4.0.rc2 app/models/concerns/spree/named_type.rb
spree_core-3.4.0.rc1 app/models/concerns/spree/named_type.rb