Module: ActsAsShoppingCart::Schema

Defined in:
lib/acts_as_shopping_cart/schema.rb

Instance Method Summary collapse

Instance Method Details

#shopping_cart_item_fieldsObject



5
6
7
8
9
10
11
12
13
# File 'lib/acts_as_shopping_cart/schema.rb', line 5

def shopping_cart_item_fields
  integer :owner_id       # Holds the owner id, for polymorphism
  string  :owner_type     # Holds the type of the owner, for polymorphism
  integer :quantity       # Holds the quantity of the object
  integer :item_id        # Holds the object id
  string  :item_type      # Holds the type of the object, for polymorphism
  integer :price_cents, default: 0, null: false  # Holds the price of the item
  string  :price_currency, default: "USD", null: false # Holds the currency for the price
end