Sha256: 510a856c3f095693b32a79b6a394889fa34cb0a22633f3c6e85cab0d8dd77572

Contents?: true

Size: 291 Bytes

Versions: 26

Compression:

Stored size: 291 Bytes

Contents

module Spree
  module NamedType
    extend ActiveSupport::Concern

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

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

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
spree_core-3.3.6 app/models/concerns/spree/named_type.rb
spree_core-3.3.5 app/models/concerns/spree/named_type.rb
spree_core-3.3.4 app/models/concerns/spree/named_type.rb
spree_core-3.3.3 app/models/concerns/spree/named_type.rb
spree_core-3.3.2 app/models/concerns/spree/named_type.rb
spree_core-3.3.1 app/models/concerns/spree/named_type.rb
spree_core-3.3.0 app/models/concerns/spree/named_type.rb
spree_core-3.3.0.rc4 app/models/concerns/spree/named_type.rb
spree_core-3.3.0.rc3 app/models/concerns/spree/named_type.rb
spree_core-3.3.0.rc2 app/models/concerns/spree/named_type.rb
spree_core-3.3.0.rc1 app/models/concerns/spree/named_type.rb
spree_core-3.0.10 app/models/concerns/spree/named_type.rb
spree_core-3.0.9 app/models/concerns/spree/named_type.rb
spree_core-3.0.8 app/models/concerns/spree/named_type.rb
spree_core-3.0.7 app/models/concerns/spree/named_type.rb
spree_core-3.0.6.1 app/models/concerns/spree/named_type.rb
spree_core-3.0.6 app/models/concerns/spree/named_type.rb
spree_core-3.0.5 app/models/concerns/spree/named_type.rb
spree_core-3.0.4 app/models/concerns/spree/named_type.rb
spree_core-3.0.3 app/models/concerns/spree/named_type.rb