Class: KB::Product

Inherits:
BaseModel show all
Includes:
Findable, Listable
Defined in:
lib/kb/models/product.rb

Constant Summary collapse

STRING_FIELDS =
%i[key country name type].freeze
STRING_ARRAY_FIELDS =
%i[exclusions inclusions features claimable_by languages].freeze
FIELDS =
[*STRING_FIELDS, *STRING_ARRAY_FIELDS, :purchasable].freeze

Instance Attribute Summary

Attributes inherited from BaseModel

#persisted

Class Method Summary collapse

Methods included from Findable

#reload

Methods inherited from BaseModel

#==, define_attribute_methods, define_attributes, #initialize, #persist!, #persisted?

Methods included from Inspectionable

#inspect

Constructor Details

This class inherits a constructor from KB::BaseModel

Class Method Details

.by_country(country) ⇒ Object



8
9
10
# File 'lib/kb/models/product.rb', line 8

def self.by_country(country)
  all(country: country)
end