Module: Carter::ActiveRecord::InstanceMethods
- Defined in:
- lib/carter/cartable.rb
Instance Method Summary collapse
- #after_purchase_method ⇒ Object
- #allow_multiples? ⇒ Boolean
- #cartable_name ⇒ Object
- #cartable_price ⇒ Object
- #in_cart?(cart, owner = nil) ⇒ Boolean
Instance Method Details
#after_purchase_method ⇒ Object
49 50 51 |
# File 'lib/carter/cartable.rb', line 49 def after_purchase_method cartable_configuration_value_by_key :after_purchase_method end |
#allow_multiples? ⇒ Boolean
45 46 47 |
# File 'lib/carter/cartable.rb', line 45 def allow_multiples? !cartable_configuration_value_by_key(:unique) end |
#cartable_name ⇒ Object
37 38 39 |
# File 'lib/carter/cartable.rb', line 37 def cartable_name self.send(cartable_configuration_value_by_key(:name)) end |
#cartable_price ⇒ Object
33 34 35 |
# File 'lib/carter/cartable.rb', line 33 def cartable_price self.send(cartable_configuration_value_by_key(:price)) end |
#in_cart?(cart, owner = nil) ⇒ Boolean
41 42 43 |
# File 'lib/carter/cartable.rb', line 41 def in_cart?(cart, owner=nil) cart.cart_item_for_cartable_and_owner(self, owner).present? end |