| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Potion Store
Revision: 63
Author: andykim78
Date: 11 Dec 2007 19:12:28
Changes:Bug fix of previous commit
Files:| ... | ...@@ -241,8 +241,9 @@ | |
| 241 | 241 | return false if not self.add_form_items({product_id => items[product_id]}) |
| 242 | 242 | else |
| 243 | 243 | quantity = Integer(items[product_id]) |
| 244 | # just ignore negative quantity | |
| 244 | 245 | if quantity < 0 |
| 245 | return false | |
| 246 | next | |
| 246 | 247 | elsif quantity == 0 |
| 247 | 248 | litem.destroy() |
| 248 | 249 | self.line_items.delete(litem) |
| ... | ...@@ -1,3 +1,6 @@ | |
| 1 | 2007-12-11 Andy Kim <andy@potionfactory.com> | |
| 2 | * Bug fix of previous commit | |
| 3 | ||
| 1 | 4 | 2007-12-10 Andy Kim <andy@potionfactory.com> |
| 2 | 5 | * Improved admin order edit interface: |
| 3 | 6 |
| ... | ...@@ -10,9 +10,10 @@ | |
| 10 | 10 | def quantity=(qty) |
| 11 | 11 | regenerate_keys = (self.quantity != qty) |
| 12 | 12 | write_attribute(:quantity, qty) |
| 13 | if regenerate_keys | |
| 13 | # Regenerate the license key if this is not a new record and the quantity changes | |
| 14 | if regenerate_keys && !new_record? | |
| 14 | 15 | self.license_key = generate_license_key() |
| 15 | save() if !new_record? | |
| 16 | save() | |
| 16 | 17 | end |
| 17 | 18 | end |
| 18 | 19 |