Class: Spree::OptionType
- Inherits:
-
Object
- Object
- Spree::OptionType
- Includes:
- Metadata, Metafields, ParameterizableName, TranslatableResource, UniqueName, Webhooks::HasWebhooks
- Defined in:
- app/models/spree/option_type.rb
Constant Summary collapse
- COLOR_NAMES =
%w[color colour].freeze
- TRANSLATABLE_FIELDS =
i[presentation].freeze
Class Method Summary collapse
Instance Method Summary collapse
- #color? ⇒ Boolean
-
#filter_param ⇒ Object
legacy, name itself is now parameterized before saving.
Class Method Details
.color ⇒ Object
69 70 71 |
# File 'app/models/spree/option_type.rb', line 69 def self.color colors.first end |
Instance Method Details
#color? ⇒ Boolean
73 74 75 |
# File 'app/models/spree/option_type.rb', line 73 def color? name.in?(COLOR_NAMES) end |
#filter_param ⇒ Object
legacy, name itself is now parameterized before saving
64 65 66 67 |
# File 'app/models/spree/option_type.rb', line 64 def filter_param Spree::Deprecation.warn('Spree::OptionType#filter_param is deprecated and will be removed in Spree 6. Please use Spree::OptionType#name instead.') name.parameterize end |