Method: Spree::Variant#weight=

Defined in:
app/models/spree/variant.rb

#weight=(weight) ⇒ Bignum

Sets the weight for the variant.

Parameters:

  • weight (Any)

    the weight to set

Returns:

  • (Bignum)


182
183
184
# File 'app/models/spree/variant.rb', line 182

def weight=(weight)
  self[:weight] = Spree::LocalizedNumber.parse(weight) if weight.present?
end