Class: Shoppy::Variant

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Concerns::Models::Hashable, Concerns::Models::Optionable, Concerns::Models::Promotional
Defined in:
app/models/shoppy/variant.rb

Direct Known Subclasses

Variant

Instance Method Summary collapse

Instance Method Details

#nameObject

Validators



20
# File 'app/models/shoppy/variant.rb', line 20

validates :name, presence: true

#productObject

Relationships



4
# File 'app/models/shoppy/variant.rb', line 4

belongs_to :product

#variant_detailsObject



25
26
27
# File 'app/models/shoppy/variant.rb', line 25

def variant_details
  "#{self.name} - #{self.price}"
end