Class: TransactionPage
- Inherits:
-
Page
- Object
- Page
- TransactionPage
- Defined in:
- lib/models/transaction_page.rb
Instance Method Summary collapse
-
#cart ⇒ Object
TODO: find way to abstract this.
- #products ⇒ Object
- #successful? ⇒ Boolean
Instance Method Details
#cart ⇒ Object
TODO: find way to abstract this
4 5 6 7 8 9 10 11 |
# File 'lib/models/transaction_page.rb', line 4 def cart if logged_in? @cart ||= site.carts.where(transaction: nil, user: current_user.id).order('created desc').first else # TODO: need to track by session nil end end |
#products ⇒ Object
17 18 19 |
# File 'lib/models/transaction_page.rb', line 17 def products cart.product_holds.collect(&:product) end |
#successful? ⇒ Boolean
13 14 15 |
# File 'lib/models/transaction_page.rb', line 13 def successful? @successful end |