piggybak 0.4.12 → 0.4.13

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.12
1
+ 0.4.13
@@ -72,15 +72,31 @@ module Piggybak
72
72
  redirect_to rails_admin.edit_path('Piggybak::Order', order.id)
73
73
  end
74
74
 
75
+ def restore
76
+ order = Order.find(params[:id])
77
+
78
+ if can?(:restore, order)
79
+ order.update_attribute(:status, "new")
80
+ end
81
+
82
+ redirect_to rails_admin.edit_path('Piggybak::Order', order.id)
83
+ end
84
+
75
85
  def cancel
76
86
  order = Order.find(params[:id])
77
87
 
78
88
  if can?(:cancel, order)
89
+ cancelled_items = []
90
+ order.line_items.each do |line_item|
91
+ cancelled_items << "#{line_item.quantity}:#{line_item.variant.sku}"
92
+ line_item.destroy
93
+ end
79
94
  order.payments.each do |payment|
80
95
  payment.refund
81
96
  end
82
97
  order.update_attribute(:status, "cancelled")
83
- flash[:notice] = "Cancelled"
98
+
99
+ flash[:notice] = "Order #{order.id} cancelled"
84
100
  end
85
101
 
86
102
  redirect_to rails_admin.edit_path('Piggybak::Order', order.id)
@@ -2,6 +2,8 @@ module Piggybak
2
2
  class Address < ActiveRecord::Base
3
3
  belongs_to :state
4
4
  belongs_to :country
5
+ has_one :order_shipping, :foreign_key => "shipping_address_id", :class_name => "Piggybak::Order"
6
+ has_one :order_billing, :foreign_key => "billing_address_id", :class_name => "Piggybak::Order"
5
7
 
6
8
  validates_presence_of :firstname
7
9
  validates_presence_of :lastname
@@ -12,6 +14,7 @@ module Piggybak
12
14
  validates_presence_of :zip
13
15
 
14
16
  after_initialize :set_default_country
17
+ after_save :document_address_changes
15
18
 
16
19
  def set_default_country
17
20
  self.country ||= Country.find_by_abbr(Piggybak.config.default_country)
@@ -32,5 +35,15 @@ module Piggybak
32
35
  def state_display
33
36
  self.state ? self.state.name : self.state_id
34
37
  end
38
+
39
+ def document_address_changes
40
+ # TODO: Fix this. It isn't working.
41
+ if self.order_billing.present? && self.changed?
42
+ self.order_billing.recorded_changes << self.formatted_changes
43
+ end
44
+ if self.order_shipping.present? && self.changed?
45
+ self.order_shipping.recorded_changes << self.formatted_changes
46
+ end
47
+ end
35
48
  end
36
49
  end
@@ -1,6 +1,7 @@
1
1
  module Piggybak
2
2
  class LineItem < ActiveRecord::Base
3
3
  belongs_to :order
4
+ acts_as_changer
4
5
  belongs_to :variant
5
6
 
6
7
  validates_presence_of :variant_id
@@ -4,6 +4,7 @@ module Piggybak
4
4
  has_many :payments, :inverse_of => :order
5
5
  has_many :shipments, :inverse_of => :order
6
6
  has_many :credits, :inverse_of => :order
7
+ has_many :order_notes, :inverse_of => :order
7
8
 
8
9
  belongs_to :billing_address, :class_name => "Piggybak::Address"
9
10
  belongs_to :shipping_address, :class_name => "Piggybak::Address"
@@ -14,6 +15,10 @@ module Piggybak
14
15
  accepts_nested_attributes_for :shipments, :allow_destroy => true
15
16
  accepts_nested_attributes_for :line_items, :allow_destroy => true
16
17
  accepts_nested_attributes_for :payments
18
+ accepts_nested_attributes_for :order_notes
19
+
20
+ attr_accessor :recorded_changes
21
+ attr_accessor :recorded_changer
17
22
 
18
23
  validates_presence_of :status, :email, :phone, :total, :total_due, :tax_charge, :created_at, :ip_address, :user_agent
19
24
 
@@ -21,10 +26,13 @@ module Piggybak
21
26
  before_validation :set_defaults
22
27
  after_validation :update_totals
23
28
  before_save :process_payments, :update_status
29
+ after_save :record_order_note
24
30
 
25
31
  default_scope :order => 'created_at DESC'
26
32
 
27
33
  def initialize_nested
34
+ self.recorded_changes ||= []
35
+
28
36
  self.billing_address ||= Piggybak::Address.new
29
37
  self.shipping_address ||= Piggybak::Address.new
30
38
  self.shipments ||= [Piggybak::Shipment.new]
@@ -64,6 +72,16 @@ module Piggybak
64
72
  !has_errors
65
73
  end
66
74
 
75
+ def record_order_note
76
+ if self.changed?
77
+ self.recorded_changes << self.formatted_changes
78
+ end
79
+
80
+ if self.recorded_changes.any?
81
+ OrderNote.create(:order_id => self.id, :note => self.recorded_changes.join("<br />"), :user_id => self.recorded_changer.to_i)
82
+ end
83
+ end
84
+
67
85
  def add_line_items(cart)
68
86
  cart.update_quantities
69
87
  cart.items.each do |item|
@@ -130,10 +148,8 @@ module Piggybak
130
148
  def update_status
131
149
  return if self.status == "cancelled" # do nothing
132
150
 
133
- if self.total_due > 0.00
134
- self.status = "payment_owed"
135
- elsif self.total_due < 0.00
136
- self.status = "credit_owed"
151
+ if self.total_due != 0.00
152
+ self.status = "unbalanced"
137
153
  else
138
154
  if self.shipments.any? && self.shipments.all? { |s| s.status == "shipped" }
139
155
  self.status = "shipped"
@@ -0,0 +1,17 @@
1
+ module Piggybak
2
+ class OrderNote < ActiveRecord::Base
3
+ attr_accessible :user_id, :order_id, :note, :created_at
4
+ validates_presence_of :user_id, :order_id
5
+
6
+ belongs_to :order
7
+ belongs_to :user
8
+
9
+ def details
10
+ "<b>#{created_at.strftime("%m-%d-%Y %H:%M")}</b> by #{user.email}:<br />#{note}"
11
+ end
12
+
13
+ def admin_label
14
+ "Order Note: #{created_at.strftime("%m-%d-%Y %H:%M")}"
15
+ end
16
+ end
17
+ end
@@ -1,6 +1,7 @@
1
1
  module Piggybak
2
2
  class Payment < ActiveRecord::Base
3
3
  belongs_to :order
4
+ acts_as_changer
4
5
  belongs_to :payment_method
5
6
 
6
7
  validates_presence_of :status
@@ -1,6 +1,7 @@
1
1
  module Piggybak
2
2
  class Shipment < ActiveRecord::Base
3
3
  belongs_to :order
4
+ acts_as_changer
4
5
  belongs_to :shipping_method
5
6
 
6
7
  validates_presence_of :status
@@ -18,14 +18,17 @@ N/A
18
18
  <td>Order Total</td>
19
19
  <td>$<%= "%.2f" % form.object.total %></td>
20
20
  </tr>
21
+ <% if form.object.status != "cancelled" -%>
21
22
  <tr>
22
23
  <td>Total Due</td>
23
24
  <td>$<%= "%.2f" % form.object.total_due %></td>
24
25
  </tr>
26
+ <% end -%>
25
27
  <tr>
26
28
  <td>Created at</td>
27
29
  <td><%= form.object.created_at.strftime("%m-%d-%Y") %></td>
28
30
  </tr>
31
+ <% if form.object.status != "cancelled" -%>
29
32
  <tr>
30
33
  <td valign="top">Actions</td>
31
34
  <td>
@@ -36,5 +39,18 @@ N/A
36
39
  </ul>
37
40
  </td>
38
41
  </tr>
42
+ <% else -%>
43
+ <tr>
44
+ <td valign="top">Actions</td>
45
+ <td>
46
+ <ul>
47
+ <li>
48
+ <%= link_to "Restore Cancel Order", piggybak.restore_order_url(form.object.id) %>
49
+ (This marks order as un-cancelled.)
50
+ </li>
51
+ </ul>
52
+ </td>
53
+ </tr>
54
+ <% end -%>
39
55
  </table>
40
56
  <% end -%>
@@ -0,0 +1 @@
1
+ Here they are!
@@ -0,0 +1 @@
1
+ <input type="hidden" name="piggybak_order[recorded_changer]" value="<%= current_user.id %>" />
@@ -20,6 +20,7 @@ Piggybak::Engine.routes.draw do
20
20
  match "/admin/orders/:id/email" => "orders#email", :as => :email_order
21
21
  match "/admin/orders/:id/download" => "orders#download", :as => :download_order, :format => "txt"
22
22
  match "/admin/orders/:id/cancel" => "orders#cancel", :as => :cancel_order
23
+ match "/admin/orders/:id/restore" => "orders#restore", :as => :restore_order
23
24
  match "/admin/payments/:id/refund" => "payments#refund", :as => :refund_payment
24
25
  end
25
26
  end
@@ -0,0 +1,10 @@
1
+ class CreateOrderNotes < ActiveRecord::Migration
2
+ def change
3
+ create_table :order_notes do |t|
4
+ t.references :order, :null => false
5
+ t.references :user, :null => false
6
+ t.text :note
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,31 @@
1
+ module Piggybak
2
+ module ActsAsChanger
3
+ extend ActiveSupport::Concern
4
+
5
+ module ClassMethods
6
+ def acts_as_changer
7
+ after_create :document_new_item
8
+ after_update :document_nested_change
9
+ after_destroy :document_destroy_item
10
+ end
11
+ end
12
+
13
+ module InstanceMethods
14
+ def document_new_item
15
+ self.order.recorded_changes << self.new_destroy_changes("added")
16
+ end
17
+
18
+ def document_nested_change
19
+ if self.changed?
20
+ self.order.recorded_changes << self.formatted_changes
21
+ end
22
+ end
23
+
24
+ def document_destroy_item
25
+ self.order.recorded_changes << self.new_destroy_changes("destroyed")
26
+ end
27
+ end
28
+ end
29
+ end
30
+
31
+ ::ActiveRecord::Base.send :include, Piggybak::ActsAsChanger
@@ -5,6 +5,8 @@ module Piggybak
5
5
  module ClassMethods
6
6
  def acts_as_orderer
7
7
  has_many :piggybak_orders, :foreign_key => "user_id", :class_name => "::Piggybak::Order"
8
+
9
+ has_many :order_notes, :foreign_key => "user_id", :class_name => "::Piggybak::OrderNote"
8
10
  end
9
11
  end
10
12
  end
@@ -0,0 +1,39 @@
1
+ module Piggybak
2
+ module FormattedChanges
3
+ extend ActiveSupport::Concern
4
+
5
+ module InstanceMethods
6
+ def new_destroy_changes(type)
7
+ text = "#{self.class.to_s.gsub(/Piggybak::/, '')} ##{self.id} #{type}:<br />"
8
+ self.attributes.each do |k, v|
9
+ if !["upated_at", "created_at", "id", "order_id"].include?(k)
10
+ if v.is_a?(BigDecimal)
11
+ text += "#{k}: $#{format("%.2f", v)}<br />"
12
+ else
13
+ text += "#{k}: #{v}<br />"
14
+ end
15
+ end
16
+ end
17
+
18
+ return text
19
+ end
20
+
21
+ def formatted_changes
22
+ text = "#{self.class.to_s.gsub(/Piggybak::/, '')} ##{self.id} changes:<br />"
23
+ self.changes.each do |k, v|
24
+ if k != "updated_at"
25
+ if v[0].is_a?(BigDecimal)
26
+ text += "#{k} from $#{format("%.2f", v[0])} to $#{format("%.2f", v[1])}<br />"
27
+ else
28
+ text += "#{k} from #{v[0]} to #{v[1]}<br />"
29
+ end
30
+ end
31
+ end
32
+
33
+ return text
34
+ end
35
+ end
36
+ end
37
+ end
38
+
39
+ ::ActiveRecord::Base.send :include, Piggybak::FormattedChanges
@@ -1,7 +1,9 @@
1
1
  require 'piggybak/config'
2
2
  require 'acts_as_variant'
3
3
  require 'acts_as_orderer'
4
+ require 'acts_as_changer'
4
5
  require 'active_merchant'
6
+ require 'formatted_changes'
5
7
  require 'currency'
6
8
 
7
9
  module Piggybak
@@ -64,6 +66,11 @@ module Piggybak
64
66
  field :shipping_address
65
67
  field :shipments
66
68
  field :payments
69
+ field :order_notes do
70
+ pretty_value do
71
+ value.inject([]) { |arr, o| arr << o.details }.join("<br /><br />").html_safe
72
+ end
73
+ end
67
74
  end
68
75
  list do
69
76
  field :id
@@ -85,6 +92,15 @@ module Piggybak
85
92
  field :status
86
93
  end
87
94
  edit do
95
+ field :recorded_changer, :hidden do
96
+ partial "recorded_changer"
97
+ end
98
+ # TODO: Figure out why this doesn't work here
99
+ #field :recorded_changer, :hidden do
100
+ # default_value do
101
+ # bindings[:view]._current_user.id
102
+ # end
103
+ #end
88
104
  field :status do
89
105
  visible do
90
106
  !bindings[:object].new_record?
@@ -126,9 +142,44 @@ module Piggybak
126
142
  field :payments do
127
143
  active true
128
144
  end
145
+ field :order_notes do
146
+ active true
147
+ end
129
148
  end
130
149
  end
131
-
150
+
151
+ config.model Piggybak::OrderNote do
152
+ object_label_method :admin_label
153
+ visible false
154
+ list do
155
+ field :user
156
+ field :note
157
+ field :created_at
158
+ end
159
+ edit do
160
+ field :details do
161
+ label "Order Note"
162
+ help ""
163
+ visible do
164
+ !bindings[:object].new_record?
165
+ end
166
+ read_only do
167
+ !bindings[:object].new_record?
168
+ end
169
+ end
170
+ field :user_id, :hidden do
171
+ default_value do
172
+ bindings[:view]._current_user.id
173
+ end
174
+ end
175
+ field :note do
176
+ visible do
177
+ bindings[:object].new_record?
178
+ end
179
+ end
180
+ end
181
+ end
182
+
132
183
  config.model Piggybak::Address do
133
184
  label "Address"
134
185
  object_label_method :admin_label
@@ -232,6 +283,9 @@ module Piggybak
232
283
  end
233
284
  field :total do
234
285
  read_only true
286
+ visible do
287
+ !bindings[:object].new_record?
288
+ end
235
289
  formatted_value do
236
290
  "$%.2f" % value
237
291
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "piggybak"
8
- s.version = "0.4.12"
8
+ s.version = "0.4.13"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Steph Skardal", "Brian Buchalter"]
12
- s.date = "2012-07-16"
12
+ s.date = "2012-07-17"
13
13
  s.description = "Mountable ecommerce"
14
14
  s.email = "steph@endpoint.com"
15
15
  s.extra_rdoc_files = [
@@ -37,6 +37,7 @@ Gem::Specification.new do |s|
37
37
  "app/models/piggybak/credit.rb",
38
38
  "app/models/piggybak/line_item.rb",
39
39
  "app/models/piggybak/order.rb",
40
+ "app/models/piggybak/order_note.rb",
40
41
  "app/models/piggybak/payment.rb",
41
42
  "app/models/piggybak/payment_calculator/authorize_net.rb",
42
43
  "app/models/piggybak/payment_calculator/fake.rb",
@@ -67,7 +68,9 @@ Gem::Specification.new do |s|
67
68
  "app/views/piggybak/orders/submit.html.erb",
68
69
  "app/views/rails_admin/main/_location_select.html.haml",
69
70
  "app/views/rails_admin/main/_order_details.html.erb",
71
+ "app/views/rails_admin/main/_order_notes.html.erb",
70
72
  "app/views/rails_admin/main/_payment_refund.html.haml",
73
+ "app/views/rails_admin/main/_recorded_changer.html.erb",
71
74
  "config/routes.rb",
72
75
  "db/migrate/20111227150106_create_orders.rb",
73
76
  "db/migrate/20111227150322_create_addresses.rb",
@@ -91,9 +94,12 @@ Gem::Specification.new do |s|
91
94
  "db/migrate/20120627173754_add_description_to_line_item.rb",
92
95
  "db/migrate/20120716191225_add_masked_credit_card_numbers.rb",
93
96
  "db/migrate/20120716195806_order_debugging.rb",
97
+ "db/migrate/20120717022155_create_order_notes.rb",
98
+ "lib/acts_as_changer.rb",
94
99
  "lib/acts_as_orderer.rb",
95
100
  "lib/acts_as_variant.rb",
96
101
  "lib/currency.rb",
102
+ "lib/formatted_changes.rb",
97
103
  "lib/piggybak.rb",
98
104
  "lib/piggybak/config.rb",
99
105
  "piggybak.gemspec",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piggybak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.12
4
+ version: 0.4.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-07-16 00:00:00.000000000 Z
13
+ date: 2012-07-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: countries
17
- requirement: &21782180 !ruby/object:Gem::Requirement
17
+ requirement: &16531060 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *21782180
25
+ version_requirements: *16531060
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: bundler
28
- requirement: &21781680 !ruby/object:Gem::Requirement
28
+ requirement: &16530480 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 1.0.0
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *21781680
36
+ version_requirements: *16530480
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: jeweler
39
- requirement: &21780900 !ruby/object:Gem::Requirement
39
+ requirement: &16529740 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.6.4
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *21780900
47
+ version_requirements: *16529740
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rspec
50
- requirement: &21779940 !ruby/object:Gem::Requirement
50
+ requirement: &16528980 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *21779940
58
+ version_requirements: *16528980
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rspec-rails
61
- requirement: &21798680 !ruby/object:Gem::Requirement
61
+ requirement: &16528280 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ~>
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 2.7.0
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *21798680
69
+ version_requirements: *16528280
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: factory_girl
72
- requirement: &21798060 !ruby/object:Gem::Requirement
72
+ requirement: &16527660 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *21798060
80
+ version_requirements: *16527660
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: diff-lcs
83
- requirement: &21797220 !ruby/object:Gem::Requirement
83
+ requirement: &16545180 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: '0'
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *21797220
91
+ version_requirements: *16545180
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: shoulda
94
- requirement: &21796400 !ruby/object:Gem::Requirement
94
+ requirement: &16544000 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ! '>='
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: '0'
100
100
  type: :development
101
101
  prerelease: false
102
- version_requirements: *21796400
102
+ version_requirements: *16544000
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: simplecov
105
- requirement: &21795840 !ruby/object:Gem::Requirement
105
+ requirement: &16543300 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ! '>='
@@ -110,10 +110,10 @@ dependencies:
110
110
  version: '0'
111
111
  type: :development
112
112
  prerelease: false
113
- version_requirements: *21795840
113
+ version_requirements: *16543300
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: tzinfo
116
- requirement: &21795280 !ruby/object:Gem::Requirement
116
+ requirement: &16542580 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
119
  - - ! '>='
@@ -121,10 +121,10 @@ dependencies:
121
121
  version: '0'
122
122
  type: :development
123
123
  prerelease: false
124
- version_requirements: *21795280
124
+ version_requirements: *16542580
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: devise
127
- requirement: &21794700 !ruby/object:Gem::Requirement
127
+ requirement: &16541980 !ruby/object:Gem::Requirement
128
128
  none: false
129
129
  requirements:
130
130
  - - ! '>='
@@ -132,10 +132,10 @@ dependencies:
132
132
  version: '0'
133
133
  type: :development
134
134
  prerelease: false
135
- version_requirements: *21794700
135
+ version_requirements: *16541980
136
136
  - !ruby/object:Gem::Dependency
137
137
  name: rails_admin
138
- requirement: &21794020 !ruby/object:Gem::Requirement
138
+ requirement: &16541260 !ruby/object:Gem::Requirement
139
139
  none: false
140
140
  requirements:
141
141
  - - ! '>='
@@ -143,10 +143,10 @@ dependencies:
143
143
  version: '0'
144
144
  type: :runtime
145
145
  prerelease: false
146
- version_requirements: *21794020
146
+ version_requirements: *16541260
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: devise
149
- requirement: &21793380 !ruby/object:Gem::Requirement
149
+ requirement: &16540440 !ruby/object:Gem::Requirement
150
150
  none: false
151
151
  requirements:
152
152
  - - ! '>='
@@ -154,10 +154,10 @@ dependencies:
154
154
  version: '0'
155
155
  type: :runtime
156
156
  prerelease: false
157
- version_requirements: *21793380
157
+ version_requirements: *16540440
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: activemerchant
160
- requirement: &21792720 !ruby/object:Gem::Requirement
160
+ requirement: &16539760 !ruby/object:Gem::Requirement
161
161
  none: false
162
162
  requirements:
163
163
  - - ! '>='
@@ -165,10 +165,10 @@ dependencies:
165
165
  version: '0'
166
166
  type: :runtime
167
167
  prerelease: false
168
- version_requirements: *21792720
168
+ version_requirements: *16539760
169
169
  - !ruby/object:Gem::Dependency
170
170
  name: countries
171
- requirement: &21792020 !ruby/object:Gem::Requirement
171
+ requirement: &16539180 !ruby/object:Gem::Requirement
172
172
  none: false
173
173
  requirements:
174
174
  - - ! '>='
@@ -176,10 +176,10 @@ dependencies:
176
176
  version: '0'
177
177
  type: :runtime
178
178
  prerelease: false
179
- version_requirements: *21792020
179
+ version_requirements: *16539180
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: rspec
182
- requirement: &21791360 !ruby/object:Gem::Requirement
182
+ requirement: &16538640 !ruby/object:Gem::Requirement
183
183
  none: false
184
184
  requirements:
185
185
  - - ! '>='
@@ -187,10 +187,10 @@ dependencies:
187
187
  version: '0'
188
188
  type: :development
189
189
  prerelease: false
190
- version_requirements: *21791360
190
+ version_requirements: *16538640
191
191
  - !ruby/object:Gem::Dependency
192
192
  name: rspec-rails
193
- requirement: &21790720 !ruby/object:Gem::Requirement
193
+ requirement: &16538040 !ruby/object:Gem::Requirement
194
194
  none: false
195
195
  requirements:
196
196
  - - ! '>='
@@ -198,10 +198,10 @@ dependencies:
198
198
  version: '0'
199
199
  type: :development
200
200
  prerelease: false
201
- version_requirements: *21790720
201
+ version_requirements: *16538040
202
202
  - !ruby/object:Gem::Dependency
203
203
  name: diff-lcs
204
- requirement: &21808120 !ruby/object:Gem::Requirement
204
+ requirement: &16537540 !ruby/object:Gem::Requirement
205
205
  none: false
206
206
  requirements:
207
207
  - - ! '>='
@@ -209,10 +209,10 @@ dependencies:
209
209
  version: '0'
210
210
  type: :development
211
211
  prerelease: false
212
- version_requirements: *21808120
212
+ version_requirements: *16537540
213
213
  - !ruby/object:Gem::Dependency
214
214
  name: factory_girl
215
- requirement: &21807420 !ruby/object:Gem::Requirement
215
+ requirement: &16557200 !ruby/object:Gem::Requirement
216
216
  none: false
217
217
  requirements:
218
218
  - - ! '>='
@@ -220,10 +220,10 @@ dependencies:
220
220
  version: '0'
221
221
  type: :development
222
222
  prerelease: false
223
- version_requirements: *21807420
223
+ version_requirements: *16557200
224
224
  - !ruby/object:Gem::Dependency
225
225
  name: shoulda
226
- requirement: &21806760 !ruby/object:Gem::Requirement
226
+ requirement: &16556620 !ruby/object:Gem::Requirement
227
227
  none: false
228
228
  requirements:
229
229
  - - ! '>='
@@ -231,7 +231,7 @@ dependencies:
231
231
  version: '0'
232
232
  type: :development
233
233
  prerelease: false
234
- version_requirements: *21806760
234
+ version_requirements: *16556620
235
235
  description: Mountable ecommerce
236
236
  email: steph@endpoint.com
237
237
  executables: []
@@ -260,6 +260,7 @@ files:
260
260
  - app/models/piggybak/credit.rb
261
261
  - app/models/piggybak/line_item.rb
262
262
  - app/models/piggybak/order.rb
263
+ - app/models/piggybak/order_note.rb
263
264
  - app/models/piggybak/payment.rb
264
265
  - app/models/piggybak/payment_calculator/authorize_net.rb
265
266
  - app/models/piggybak/payment_calculator/fake.rb
@@ -290,7 +291,9 @@ files:
290
291
  - app/views/piggybak/orders/submit.html.erb
291
292
  - app/views/rails_admin/main/_location_select.html.haml
292
293
  - app/views/rails_admin/main/_order_details.html.erb
294
+ - app/views/rails_admin/main/_order_notes.html.erb
293
295
  - app/views/rails_admin/main/_payment_refund.html.haml
296
+ - app/views/rails_admin/main/_recorded_changer.html.erb
294
297
  - config/routes.rb
295
298
  - db/migrate/20111227150106_create_orders.rb
296
299
  - db/migrate/20111227150322_create_addresses.rb
@@ -314,9 +317,12 @@ files:
314
317
  - db/migrate/20120627173754_add_description_to_line_item.rb
315
318
  - db/migrate/20120716191225_add_masked_credit_card_numbers.rb
316
319
  - db/migrate/20120716195806_order_debugging.rb
320
+ - db/migrate/20120717022155_create_order_notes.rb
321
+ - lib/acts_as_changer.rb
317
322
  - lib/acts_as_orderer.rb
318
323
  - lib/acts_as_variant.rb
319
324
  - lib/currency.rb
325
+ - lib/formatted_changes.rb
320
326
  - lib/piggybak.rb
321
327
  - lib/piggybak/config.rb
322
328
  - piggybak.gemspec
@@ -391,7 +397,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
391
397
  version: '0'
392
398
  segments:
393
399
  - 0
394
- hash: 1631007596627402074
400
+ hash: -1995502199532514212
395
401
  required_rubygems_version: !ruby/object:Gem::Requirement
396
402
  none: false
397
403
  requirements: