shop_bunny 0.7.4.7 → 0.7.4.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,6 +12,10 @@ class CartItem < ActiveRecord::Base
12
12
  after_save :touch_cart
13
13
  after_destroy :touch_cart
14
14
 
15
+ ShopBunny.cart_item_enhancements.each do |enhancement|
16
+ include enhancement
17
+ end
18
+
15
19
  # TODO attr_accessible :quantity
16
20
 
17
21
  def total_price
@@ -28,6 +32,12 @@ class CartItem < ActiveRecord::Base
28
32
  self.destroy if quantity.to_i <= 0
29
33
  end
30
34
 
35
+ def self.include_enhancements
36
+ ShopBunny.cart_item_enhancements.each do |enhancement|
37
+ include enhancement
38
+ end
39
+ end
40
+
31
41
  protected
32
42
  def touch_cart
33
43
  cart.touch if cart
data/lib/shop_bunny.rb CHANGED
@@ -11,8 +11,8 @@ module ShopBunny
11
11
  mattr_accessor :shipping_cost_calculator
12
12
  @@shipping_cost_calculator = ShopBunny::ShippingCostCalculator
13
13
 
14
- mattr_accessor :controller_enhancement
15
- @@controller_enhancement = nil
14
+ mattr_accessor :cart_item_enhancements
15
+ @@cart_item_enhancements ||= []
16
16
 
17
17
  # This is the default way to setup ShopBunny and is used in the
18
18
  # initializer which gets generated by `rails generate shop_bunny:install`
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shop_bunny
3
3
  version: !ruby/object:Gem::Version
4
- hash: 105
4
+ hash: 119
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
9
  - 4
10
- - 7
11
- version: 0.7.4.7
10
+ - 8
11
+ version: 0.7.4.8
12
12
  platform: ruby
13
13
  authors:
14
14
  - kopfmaschine.com
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-11-18 00:00:00 +01:00
19
+ date: 2010-11-19 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies: []
22
22