shoppe 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -0
  3. data/app/assets/stylesheets/shoppe/application.scss +15 -4
  4. data/app/controllers/shoppe/application_controller.rb +2 -2
  5. data/app/controllers/shoppe/customers_controller.rb +10 -12
  6. data/app/models/shoppe/address.rb +14 -14
  7. data/app/models/shoppe/attachment.rb +9 -9
  8. data/app/models/shoppe/country.rb +14 -14
  9. data/app/models/shoppe/customer.rb +11 -8
  10. data/app/models/shoppe/delivery_service.rb +10 -10
  11. data/app/models/shoppe/delivery_service_price.rb +15 -15
  12. data/app/models/shoppe/order.rb +12 -9
  13. data/app/models/shoppe/order/actions.rb +15 -15
  14. data/app/models/shoppe/order/billing.rb +10 -10
  15. data/app/models/shoppe/order/delivery.rb +13 -13
  16. data/app/models/shoppe/order/states.rb +20 -20
  17. data/app/models/shoppe/order_item.rb +10 -10
  18. data/app/models/shoppe/payment.rb +7 -7
  19. data/app/models/shoppe/product.rb +24 -24
  20. data/app/models/shoppe/product/product_attributes.rb +5 -5
  21. data/app/models/shoppe/product/variants.rb +3 -3
  22. data/app/models/shoppe/product_attribute.rb +20 -20
  23. data/app/models/shoppe/product_category.rb +6 -6
  24. data/app/models/shoppe/setting.rb +13 -13
  25. data/app/models/shoppe/stock_level_adjustment.rb +5 -5
  26. data/app/models/shoppe/tax_rate.rb +16 -16
  27. data/app/models/shoppe/user.rb +13 -13
  28. data/app/uploaders/shoppe/attachment_uploader.rb +0 -1
  29. data/app/views/shoppe/customers/_addresses.html.haml +5 -5
  30. data/app/views/shoppe/customers/_form.html.haml +17 -10
  31. data/app/views/shoppe/customers/_search_form.html.haml +5 -5
  32. data/app/views/shoppe/customers/edit.html.haml +4 -4
  33. data/app/views/shoppe/customers/index.html.haml +11 -11
  34. data/app/views/shoppe/customers/new.html.haml +3 -3
  35. data/app/views/shoppe/customers/show.html.haml +11 -12
  36. data/app/views/shoppe/product_categories/index.html.haml +3 -2
  37. data/app/views/shoppe/variants/form.html.haml +0 -1
  38. data/config/locales/de.yml +58 -7
  39. data/config/locales/en.yml +38 -4
  40. data/config/locales/es-US.yml +656 -0
  41. data/config/locales/es.yml +372 -281
  42. data/config/locales/ru.yml +781 -0
  43. data/db/seeds.rb +113 -98
  44. data/lib/shoppe.rb +10 -10
  45. data/lib/shoppe/version.rb +1 -1
  46. metadata +22 -6
@@ -1,137 +1,152 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  # tax rates
4
- tax_rate = Shoppe::TaxRate.create!(:name => "Standard VAT", :rate => 20.0)
5
- exempt_tax = Shoppe::TaxRate.create!(:name => "Exempt VAT", :rate => 0.0)
4
+ tax_rate = Shoppe::TaxRate.where(name: 'Standard VAT', rate: 20.0).first_or_create
6
5
 
7
6
  # delivery services
7
+ ds = Shoppe::DeliveryService.new(name: 'Next Day Delivery', code: 'ND16', courier: 'AnyCourier', tracking_url: 'http://trackingurl.com/track/{{consignment_number}}')
8
+ if ds.save
9
+ ds.delivery_service_prices.create(code: 'Parcel', min_weight: 0, max_weight: 1, price: 5.0, cost_price: 4.50, tax_rate: tax_rate)
10
+ ds.delivery_service_prices.create(code: 'Parcel', min_weight: 1, max_weight: 5, price: 8.0, cost_price: 7.5, tax_rate: tax_rate)
11
+ ds.delivery_service_prices.create(code: 'Parcel', min_weight: 5, max_weight: 20, price: 10.0, cost_price: 9.50, tax_rate: tax_rate)
12
+ end
8
13
 
9
- ds = Shoppe::DeliveryService.create!(:name => "Next Day Delivery", :code => 'ND16', :courier => 'AnyCourier', :tracking_url => 'http://trackingurl.com/track/{{consignment_number}}')
10
- ds.delivery_service_prices.create!(:code => 'Parcel', :min_weight => 0, :max_weight => 1, :price => 5.0, :cost_price => 4.50, :tax_rate => tax_rate)
11
- ds.delivery_service_prices.create!(:code => 'Parcel', :min_weight => 1, :max_weight => 5, :price => 8.0, :cost_price => 7.5, :tax_rate => tax_rate)
12
- ds.delivery_service_prices.create!(:code => 'Parcel', :min_weight => 5, :max_weight => 20, :price => 10.0, :cost_price => 9.50, :tax_rate => tax_rate)
13
-
14
- ds = Shoppe::DeliveryService.create!(:name => "Saturday Delivery", :code => 'NDSA16', :courier => 'AnyCourier', :tracking_url => 'http://trackingurl.com/track/{{consignment_number}}')
15
- ds.delivery_service_prices.create!(:code => 'Parcel', :min_weight => 0, :max_weight => 1, :price => 27.0, :cost_price => 24.00, :tax_rate => tax_rate)
16
- ds.delivery_service_prices.create!(:code => 'Parcel', :min_weight => 1, :max_weight => 5, :price => 29.0, :cost_price => 20.00, :tax_rate => tax_rate)
17
- ds.delivery_service_prices.create!(:code => 'Parcel', :min_weight => 5, :max_weight => 20, :price => 37.0, :cost_price => 32.00,:tax_rate => tax_rate)
14
+ ds = Shoppe::DeliveryService.new(name: 'Saturday Delivery', code: 'NDSA16', courier: 'AnyCourier', tracking_url: 'http://trackingurl.com/track/{{consignment_number}}')
15
+ if ds.save
16
+ ds.delivery_service_prices.create(code: 'Parcel', min_weight: 0, max_weight: 1, price: 27.0, cost_price: 24.00, tax_rate: tax_rate)
17
+ ds.delivery_service_prices.create(code: 'Parcel', min_weight: 1, max_weight: 5, price: 29.0, cost_price: 20.00, tax_rate: tax_rate)
18
+ ds.delivery_service_prices.create(code: 'Parcel', min_weight: 5, max_weight: 20, price: 37.0, cost_price: 32.00, tax_rate: tax_rate)
19
+ end
18
20
 
19
21
  # categories
20
- cat1 = Shoppe::ProductCategory.create!(:name => 'VoIP Phones')
21
- cat2 = Shoppe::ProductCategory.create!(:name => 'VoIP Accessories')
22
- cat3 = Shoppe::ProductCategory.create!(:name => 'Network Eqipment')
22
+ cat1 = Shoppe::ProductCategory.where(name: 'VoIP Phones').first_or_create
23
+ cat2 = Shoppe::ProductCategory.where(name: 'VoIP Accessories').first_or_create
23
24
 
24
25
  def get_file(name, content_type = 'image/jpeg')
25
- file = ActionDispatch::Http::UploadedFile.new(:tempfile => File.open(File.join(Shoppe.root, 'db', 'seeds_data', name), 'rb'))
26
+ file = ActionDispatch::Http::UploadedFile.new(tempfile: File.open(File.join(Shoppe.root, 'db', 'seeds_data', name), 'rb'))
26
27
  file.original_filename = name
27
28
  file.content_type = content_type
28
29
  file
29
30
  end
30
31
 
31
- lorem = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
32
+ lorem = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
33
+ eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
34
+ ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
35
+ aliquip ex ea commodo consequat. Duis aute irure dolor in
36
+ reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
37
+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
38
+ culpa qui officia deserunt mollit anim id est laborum.'
32
39
 
33
- pro = Shoppe::Product.new(:name => 'Yealink T20P', :sku => 'YL-SIP-T20P', :description => lorem, :short_description => 'If cheap & cheerful is what you’re after, the Yealink T20P is what you’re looking for.', :weight => 1.119, :price => 54.99, :cost_price => 44.99, :tax_rate => tax_rate, :featured => true)
40
+ pro = Shoppe::Product.new(name: 'Yealink T20P', sku: 'YL-SIP-T20P', description: lorem, short_description: 'If cheap & cheerful is what you’re after, the Yealink T20P is what you’re looking for.', weight: 1.119, price: 54.99, cost_price: 44.99, tax_rate: tax_rate, featured: true)
34
41
  pro.product_category_ids = cat1.id
35
42
  pro.default_image_file = get_file('t20p.jpg')
36
- pro.save!
37
- pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 17)
38
- pro.product_attributes.create!(:key => 'Manufacturer', :value => 'Yealink', :position => 1)
39
- pro.product_attributes.create!(:key => 'Model', :value => 'T20P', :position => 1)
40
- pro.product_attributes.create!(:key => 'Colour', :value => 'Black', :position => 1)
41
- pro.product_attributes.create!(:key => 'Lines', :value => '3', :position => 1)
42
- pro.product_attributes.create!(:key => 'Colour Screen?', :value => 'No', :position => 1)
43
- pro.product_attributes.create!(:key => 'Power over ethernet?', :value => 'Yes', :position => 1)
44
-
45
- pro = Shoppe::Product.new(:name => 'Yealink T22P', :sku => 'YL-SIP-T22P', :description => lorem, :short_description => lorem, :weight => 1.419, :price => 64.99, :cost_price => 56.99, :tax_rate => tax_rate)
43
+ if pro.save
44
+ pro.stock_level_adjustments.create(description: 'Initial Stock', adjustment: 17)
45
+ pro.product_attributes.create(key: 'Manufacturer', value: 'Yealink', position: 1)
46
+ pro.product_attributes.create(key: 'Model', value: 'T20P', position: 1)
47
+ pro.product_attributes.create(key: 'Colour', value: 'Black', position: 1)
48
+ pro.product_attributes.create(key: 'Lines', value: '3', position: 1)
49
+ pro.product_attributes.create(key: 'Colour Screen?', value: 'No', position: 1)
50
+ pro.product_attributes.create(key: 'Power over ethernet?', value: 'Yes', position: 1)
51
+ end
52
+
53
+ pro = Shoppe::Product.new(name: 'Yealink T22P', sku: 'YL-SIP-T22P', description: lorem, short_description: lorem, weight: 1.419, price: 64.99, cost_price: 56.99, tax_rate: tax_rate)
46
54
  pro.product_category_ids = cat1.id
47
55
  pro.default_image_file = get_file('t22p.jpg')
48
- pro.save!
49
- pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 200)
50
- pro.product_attributes.create!(:key => 'Manufacturer', :value => 'Yealink', :position => 1)
51
- pro.product_attributes.create!(:key => 'Model', :value => 'T22P', :position => 1)
52
- pro.product_attributes.create!(:key => 'Colour', :value => 'Black', :position => 1)
53
- pro.product_attributes.create!(:key => 'Lines', :value => '4', :position => 1)
54
- pro.product_attributes.create!(:key => 'Colour Screen?', :value => 'No', :position => 1)
55
- pro.product_attributes.create!(:key => 'Power over ethernet?', :value => 'Yes', :position => 1)
56
-
56
+ if pro.save
57
+ pro.stock_level_adjustments.create(description: 'Initial Stock', adjustment: 200)
58
+ pro.product_attributes.create(key: 'Manufacturer', value: 'Yealink', position: 1)
59
+ pro.product_attributes.create(key: 'Model', value: 'T22P', position: 1)
60
+ pro.product_attributes.create(key: 'Colour', value: 'Black', position: 1)
61
+ pro.product_attributes.create(key: 'Lines', value: '4', position: 1)
62
+ pro.product_attributes.create(key: 'Colour Screen?', value: 'No', position: 1)
63
+ pro.product_attributes.create(key: 'Power over ethernet?', value: 'Yes', position: 1)
64
+ end
57
65
 
58
- pro = Shoppe::Product.new(:name => 'Yealink T26P', :sku => 'YL-SIP-T26P', :description => lorem, :short_description => lorem, :weight => 2.23, :price => 88.99, :cost_price => 78.99, :tax_rate => tax_rate)
66
+ pro = Shoppe::Product.new(name: 'Yealink T26P', sku: 'YL-SIP-T26P', description: lorem, short_description: lorem, weight: 2.23, price: 88.99, cost_price: 78.99, tax_rate: tax_rate)
59
67
  pro.product_category_ids = cat1.id
60
68
  pro.default_image_file = get_file('t26p.jpg')
61
- pro.save!
62
- pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 100)
63
- pro.product_attributes.create!(:key => 'Manufacturer', :value => 'Yealink', :position => 1)
64
- pro.product_attributes.create!(:key => 'Model', :value => 'T26P', :position => 1)
65
- pro.product_attributes.create!(:key => 'Colour', :value => 'Black', :position => 1)
66
- pro.product_attributes.create!(:key => 'Lines', :value => '6', :position => 1)
67
- pro.product_attributes.create!(:key => 'Colour Screen?', :value => 'No', :position => 1)
68
- pro.product_attributes.create!(:key => 'Power over ethernet?', :value => 'Yes', :position => 1)
69
-
70
- pro = Shoppe::Product.new(:name => 'Yealink T46GN', :sku => 'YL-SIP-T46GN', :description => lorem, :short_description => 'Colourful, sharp, fast & down right sexy. The Yealink T46P will make your scream!', :weight => 2.23, :price => 149.99, :cost_price => 139.99, :tax_rate => tax_rate, :featured => true)
69
+ if pro.save
70
+ pro.stock_level_adjustments.create(description: 'Initial Stock', adjustment: 100)
71
+ pro.product_attributes.create(key: 'Manufacturer', value: 'Yealink', position: 1)
72
+ pro.product_attributes.create(key: 'Model', value: 'T26P', position: 1)
73
+ pro.product_attributes.create(key: 'Colour', value: 'Black', position: 1)
74
+ pro.product_attributes.create(key: 'Lines', value: '6', position: 1)
75
+ pro.product_attributes.create(key: 'Colour Screen?', value: 'No', position: 1)
76
+ pro.product_attributes.create(key: 'Power over ethernet?', value: 'Yes', position: 1)
77
+ end
78
+
79
+ pro = Shoppe::Product.new(name: 'Yealink T46GN', sku: 'YL-SIP-T46GN', description: lorem, short_description: 'Colourful, sharp, fast & down right sexy. The Yealink T46P will make your scream', weight: 2.23, price: 149.99, cost_price: 139.99, tax_rate: tax_rate, featured: true)
71
80
  pro.product_category_ids = cat1.id
72
81
  pro.default_image_file = get_file('t46gn.jpg')
73
- pro.save!
74
- pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 10)
75
- pro.product_attributes.create!(:key => 'Manufacturer', :value => 'Yealink', :position => 1)
76
- pro.product_attributes.create!(:key => 'Model', :value => 'T46GN', :position => 1)
77
- pro.product_attributes.create!(:key => 'Colour', :value => 'Black', :position => 1)
78
- pro.product_attributes.create!(:key => 'Lines', :value => '4', :position => 1)
79
- pro.product_attributes.create!(:key => 'Colour Screen?', :value => 'Yes', :position => 1)
80
- pro.product_attributes.create!(:key => 'Power over ethernet?', :value => 'Yes', :position => 1)
81
-
82
- pro = Shoppe::Product.new(:name => 'Snom 870', :sku => 'SM-870', :description => lorem, :short_description => 'The perfect & beautiful VoIP phone for the discerning professional desk.', :featured => true)
82
+ if pro.save
83
+ pro.stock_level_adjustments.create(description: 'Initial Stock', adjustment: 10)
84
+ pro.product_attributes.create(key: 'Manufacturer', value: 'Yealink', position: 1)
85
+ pro.product_attributes.create(key: 'Model', value: 'T46GN', position: 1)
86
+ pro.product_attributes.create(key: 'Colour', value: 'Black', position: 1)
87
+ pro.product_attributes.create(key: 'Lines', value: '4', position: 1)
88
+ pro.product_attributes.create(key: 'Colour Screen?', value: 'Yes', position: 1)
89
+ pro.product_attributes.create(key: 'Power over ethernet?', value: 'Yes', position: 1)
90
+ end
91
+
92
+ pro = Shoppe::Product.new(name: 'Snom 870', sku: 'SM-870', description: lorem, short_description: 'The perfect & beautiful VoIP phone for the discerning professional desk.', featured: true)
83
93
  pro.product_category_ids = cat1.id
84
94
  pro.default_image_file = get_file('snom-870-grey.jpg')
85
- pro.save!
86
- pro.product_attributes.create!(:key => 'Manufacturer', :value => 'Snom', :position => 1)
87
- pro.product_attributes.create!(:key => 'Model', :value => '870', :position => 1)
88
- pro.product_attributes.create!(:key => 'Colour', :value => 'Grey', :position => 1)
89
- pro.product_attributes.create!(:key => 'Lines', :value => '10', :position => 1)
90
- pro.product_attributes.create!(:key => 'Colour Screen?', :value => 'Yes', :position => 1)
91
- pro.product_attributes.create!(:key => 'Power over ethernet?', :value => 'Yes', :position => 1)
92
-
93
- v1 = pro.variants.create(:name => "White/Grey", :sku => "SM-870-GREY", :price => 230.00, :cost_price => 220, :tax_rate => tax_rate, :weight => 1.35, :default => true)
94
- v1.default_image_file = get_file('snom-870-grey.jpg')
95
- v1.save!
96
- v1.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 4)
97
-
98
-
99
- v2 = pro.variants.create(:name => "Black", :sku => "SM-870-BLK", :price => 230.00, :cost_price => 220, :tax_rate => tax_rate, :weight => 1.35)
100
- v2.default_image_file = get_file('snom-870-blk.jpg')
101
- v2.save!
102
- v2.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 2)
103
-
95
+ if pro.save
96
+ pro.product_attributes.create(key: 'Manufacturer', value: 'Snom', position: 1)
97
+ pro.product_attributes.create(key: 'Model', value: '870', position: 1)
98
+ pro.product_attributes.create(key: 'Colour', value: 'Grey', position: 1)
99
+ pro.product_attributes.create(key: 'Lines', value: '10', position: 1)
100
+ pro.product_attributes.create(key: 'Colour Screen?', value: 'Yes', position: 1)
101
+ pro.product_attributes.create(key: 'Power over ethernet?', value: 'Yes', position: 1)
102
+
103
+ v1 = pro.variants.create(name: 'White/Grey', sku: 'SM-870-GREY', price: 230.00, cost_price: 220, tax_rate: tax_rate, weight: 1.35, default: true)
104
+ v1.default_image_file = get_file('snom-870-grey.jpg')
105
+ if v1.save
106
+ v1.stock_level_adjustments.create(description: 'Initial Stock', adjustment: 4)
107
+ end
108
+
109
+ v2 = pro.variants.create(name: 'Black', sku: 'SM-870-BLK', price: 230.00, cost_price: 220, tax_rate: tax_rate, weight: 1.35)
110
+ v2.default_image_file = get_file('snom-870-blk.jpg')
111
+ if v2.save
112
+ v2.stock_level_adjustments.create(description: 'Initial Stock', adjustment: 2)
113
+ end
114
+ end
104
115
 
105
- pro = Shoppe::Product.new(:name => 'Yealink Mono Headset', :sku => 'YL-YHS32', :description => lorem, :short_description => 'If you\'re often on the phone, this headset will make your life 100x easier. Guaranteed*.', :weight => 0.890, :price => 34.99, :cost_price => 24.99, :tax_rate => tax_rate, :featured => true)
116
+ pro = Shoppe::Product.new(name: 'Yealink Mono Headset', sku: 'YL-YHS32', description: lorem, short_description: 'If you\'re often on the phone, this headset will make your life 100x easier. Guaranteed*.', weight: 0.890, price: 34.99, cost_price: 24.99, tax_rate: tax_rate, featured: true)
106
117
  pro.product_category_ids = cat2.id
107
118
  pro.default_image_file = get_file('yhs32.jpg')
108
- pro.save!
109
- pro.product_attributes.create!(:key => 'Manufacturer', :value => 'Yealink', :position => 1)
110
- pro.product_attributes.create!(:key => 'Model', :value => 'YHS32', :position => 1)
119
+ if pro.save
120
+ pro.product_attributes.create(key: 'Manufacturer', value: 'Yealink', position: 1)
121
+ pro.product_attributes.create(key: 'Model', value: 'YHS32', position: 1)
122
+ end
111
123
 
112
- pro = Shoppe::Product.new(:name => 'Snom Wired Headset (MM2)', :sku => 'SM-MM2', :description => lorem, :short_description => lorem, :weight => 0.780, :price => 38.00, :cost_price => 30, :tax_rate => tax_rate)
124
+ pro = Shoppe::Product.new(name: 'Snom Wired Headset (MM2)', sku: 'SM-MM2', description: lorem, short_description: lorem, weight: 0.780, price: 38.00, cost_price: 30, tax_rate: tax_rate)
113
125
  pro.product_category_ids = cat2.id
114
126
  pro.default_image_file = get_file('snom-mm2.jpg')
115
- pro.save!
116
- pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 7)
117
- pro.product_attributes.create!(:key => 'Manufacturer', :value => 'Snom', :position => 1)
118
- pro.product_attributes.create!(:key => 'Model', :value => 'MM2', :position => 1)
127
+ if pro.save
128
+ pro.stock_level_adjustments.create(description: 'Initial Stock', adjustment: 7)
129
+ pro.product_attributes.create(key: 'Manufacturer', value: 'Snom', position: 1)
130
+ pro.product_attributes.create(key: 'Model', value: 'MM2', position: 1)
131
+ end
119
132
 
120
- pro = Shoppe::Product.new(:name => 'Snom Wired Headset (MM3)', :sku => 'SM-MM3', :description => lorem, :short_description => lorem, :weight => 0.780, :price => 38.00, :cost_price => 30, :tax_rate => tax_rate)
133
+ pro = Shoppe::Product.new(name: 'Snom Wired Headset (MM3)', sku: 'SM-MM3', description: lorem, short_description: lorem, weight: 0.780, price: 38.00, cost_price: 30, tax_rate: tax_rate)
121
134
  pro.product_category_ids = cat2.id
122
135
  pro.default_image_file = get_file('snom-mm2.jpg')
123
- pro.save!
124
- pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 5)
125
- pro.product_attributes.create!(:key => 'Manufacturer', :value => 'Snom', :position => 1)
126
- pro.product_attributes.create!(:key => 'Model', :value => 'MM3', :position => 1)
136
+ if pro.save
137
+ pro.stock_level_adjustments.create(description: 'Initial Stock', adjustment: 5)
138
+ pro.product_attributes.create(key: 'Manufacturer', value: 'Snom', position: 1)
139
+ pro.product_attributes.create(key: 'Model', value: 'MM3', position: 1)
140
+ end
127
141
 
128
- pro = Shoppe::Product.new(:name => 'Yealink W52P', :sku => 'TL-SIP-W52P', :description => lorem, :short_description => 'Wireless SIP phones are hard to come by but this beauty from Yealink is fab.', :weight => 1.280, :price => 99.99, :cost_price => 89.99, :tax_rate => tax_rate, :featured => true)
142
+ pro = Shoppe::Product.new(name: 'Yealink W52P', sku: 'TL-SIP-W52P', description: lorem, short_description: 'Wireless SIP phones are hard to come by but this beauty from Yealink is fab.', weight: 1.280, price: 99.99, cost_price: 89.99, tax_rate: tax_rate, featured: true)
129
143
  pro.product_category_ids = cat1.id
130
144
  pro.default_image_file = get_file('w52p.jpg')
131
- pro.save!
132
- pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 10)
133
- pro.product_attributes.create!(:key => 'Manufacturer', :value => 'Snom', :position => 1)
134
- pro.product_attributes.create!(:key => 'Model', :value => 'W52P', :position => 1)
135
- pro.product_attributes.create!(:key => 'Lines', :value => '3', :position => 1)
136
- pro.product_attributes.create!(:key => 'Colour Screen?', :value => 'Yes', :position => 1)
137
- pro.product_attributes.create!(:key => 'Power over ethernet?', :value => 'No', :position => 1)
145
+ if pro.save
146
+ pro.stock_level_adjustments.create(description: 'Initial Stock', adjustment: 10)
147
+ pro.product_attributes.create(key: 'Manufacturer', value: 'Snom', position: 1)
148
+ pro.product_attributes.create(key: 'Model', value: 'W52P', position: 1)
149
+ pro.product_attributes.create(key: 'Lines', value: '3', position: 1)
150
+ pro.product_attributes.create(key: 'Colour Screen?', value: 'Yes', position: 1)
151
+ pro.product_attributes.create(key: 'Power over ethernet?', value: 'No', position: 1)
152
+ end
@@ -15,45 +15,45 @@ require 'carrierwave'
15
15
 
16
16
  module Shoppe
17
17
  class << self
18
-
19
- # The path to the root of the Shoppe applicatinio
18
+
19
+ # The path to the root of the Shoppe application
20
20
  #
21
21
  # @return [String]
22
22
  def root
23
23
  File.expand_path('../../', __FILE__)
24
24
  end
25
-
25
+
26
26
  # Shoppe settings as configured in the database
27
27
  #
28
28
  # @return [Shoppe::Settings]
29
29
  def settings
30
30
  Thread.current[:shoppe_settings] ||= Shoppe::Settings.new(Shoppe::Setting.to_hash)
31
31
  end
32
-
32
+
33
33
  # Clears the settings from the thread cache so they will be taken
34
34
  # from the database on next access
35
- #
35
+ #
36
36
  # @return [NilClass]
37
37
  def reset_settings
38
38
  Thread.current[:shoppe_settings] = nil
39
39
  end
40
-
41
- # Defines a new set of settings which should be configrable from the settings page
40
+
41
+ # Defines a new set of settings which should be configrable from the settings page
42
42
  # in the Shoppe UI.
43
43
  def add_settings_group(group, fields = [])
44
44
  settings_groups[group] ||= []
45
45
  settings_groups[group] = settings_groups[group] | fields
46
46
  end
47
-
47
+
48
48
  # All settings groups which are available for configuration on the settings page.
49
49
  #
50
50
  # @return [Hash]
51
51
  def settings_groups
52
52
  @settings_groups ||= {}
53
53
  end
54
-
54
+
55
55
  end
56
-
56
+
57
57
  end
58
58
 
59
59
  # Start your engines.
@@ -1,3 +1,3 @@
1
1
  module Shoppe
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoppe
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-09 00:00:00.000000000 Z
12
+ date: 2015-12-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -279,14 +279,28 @@ dependencies:
279
279
  requirements:
280
280
  - - "~>"
281
281
  - !ruby/object:Gem::Version
282
- version: 1.31.0
282
+ version: 1.36.0
283
283
  type: :runtime
284
284
  prerelease: false
285
285
  version_requirements: !ruby/object:Gem::Requirement
286
286
  requirements:
287
287
  - - "~>"
288
288
  - !ruby/object:Gem::Version
289
- version: 1.31.0
289
+ version: 1.36.0
290
+ - !ruby/object:Gem::Dependency
291
+ name: net-ssh
292
+ requirement: !ruby/object:Gem::Requirement
293
+ requirements:
294
+ - - "~>"
295
+ - !ruby/object:Gem::Version
296
+ version: 3.0.1
297
+ type: :runtime
298
+ prerelease: false
299
+ version_requirements: !ruby/object:Gem::Requirement
300
+ requirements:
301
+ - - "~>"
302
+ - !ruby/object:Gem::Version
303
+ version: 3.0.1
290
304
  - !ruby/object:Gem::Dependency
291
305
  name: mini_magick
292
306
  requirement: !ruby/object:Gem::Requirement
@@ -405,14 +419,14 @@ dependencies:
405
419
  requirements:
406
420
  - - "~>"
407
421
  - !ruby/object:Gem::Version
408
- version: '4.0'
422
+ version: '4.5'
409
423
  type: :development
410
424
  prerelease: false
411
425
  version_requirements: !ruby/object:Gem::Requirement
412
426
  requirements:
413
427
  - - "~>"
414
428
  - !ruby/object:Gem::Version
415
- version: '4.0'
429
+ version: '4.5'
416
430
  description: A full Rails engine providing e-commerce functionality for any Rails
417
431
  4 application.
418
432
  email:
@@ -599,9 +613,11 @@ files:
599
613
  - app/views/shoppe/variants/index.html.haml
600
614
  - config/locales/de.yml
601
615
  - config/locales/en.yml
616
+ - config/locales/es-US.yml
602
617
  - config/locales/es.yml
603
618
  - config/locales/pl.yml
604
619
  - config/locales/pt-BR.yml
620
+ - config/locales/ru.yml
605
621
  - config/routes.rb
606
622
  - db/countries.txt
607
623
  - db/migrate/20130926094549_create_shoppe_initial_schema.rb