spree_core 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. data/app/assets/images/noimage/large.png +0 -0
  2. data/app/assets/javascripts/admin/admin.js.erb +14 -14
  3. data/app/assets/javascripts/admin/checkouts/edit.js +1 -1
  4. data/app/assets/javascripts/admin/spree_core.js +0 -2
  5. data/app/assets/javascripts/store/checkout.js +2 -2
  6. data/app/assets/stylesheets/store/screen.css.scss +1 -1
  7. data/app/controllers/spree/admin/images_controller.rb +5 -13
  8. data/app/controllers/spree/admin/mail_methods_controller.rb +7 -0
  9. data/app/controllers/spree/admin/orders/customer_details_controller.rb +1 -1
  10. data/app/controllers/spree/admin/payment_methods_controller.rb +7 -1
  11. data/app/controllers/spree/admin/products_controller.rb +5 -13
  12. data/app/controllers/spree/admin/prototypes_controller.rb +2 -2
  13. data/app/controllers/spree/checkout_controller.rb +10 -0
  14. data/app/controllers/spree/orders_controller.rb +9 -5
  15. data/app/helpers/spree/base_helper.rb +17 -4
  16. data/app/helpers/spree/checkout_helper.rb +1 -9
  17. data/app/helpers/spree/products_helper.rb +0 -4
  18. data/app/models/spree/address.rb +1 -1
  19. data/app/models/spree/app_configuration.rb +1 -0
  20. data/app/models/spree/calculator/price_sack.rb +5 -3
  21. data/app/models/spree/image.rb +3 -1
  22. data/app/models/spree/inventory_unit.rb +8 -6
  23. data/app/models/spree/line_item.rb +2 -1
  24. data/app/models/spree/order.rb +23 -2
  25. data/app/models/spree/payment/processing.rb +22 -20
  26. data/app/models/spree/preferences/preferable_class_methods.rb +2 -0
  27. data/app/models/spree/preferences/store.rb +20 -2
  28. data/app/models/spree/product.rb +35 -29
  29. data/app/models/spree/product/scopes.rb +21 -6
  30. data/app/models/spree/return_authorization.rb +1 -0
  31. data/app/models/spree/shipping_method.rb +3 -0
  32. data/app/models/spree/variant.rb +19 -9
  33. data/app/views/spree/admin/images/_form.html.erb +4 -8
  34. data/app/views/spree/admin/return_authorizations/_form.html.erb +17 -33
  35. data/app/views/spree/admin/shared/_head.html.erb +2 -15
  36. data/app/views/spree/admin/shared/_order_details.html.erb +1 -1
  37. data/app/views/spree/admin/shared/_routes.html.erb +8 -0
  38. data/app/views/spree/admin/shared/_translations.html.erb +17 -0
  39. data/app/views/spree/admin/tax_rates/index.html.erb +2 -2
  40. data/app/views/spree/admin/variants/_form.html.erb +2 -2
  41. data/app/views/spree/checkout/payment/_gateway.html.erb +1 -1
  42. data/app/views/spree/order_mailer/cancel_email.text.erb +5 -5
  43. data/app/views/spree/order_mailer/confirm_email.text.erb +7 -6
  44. data/app/views/spree/products/_thumbnails.html.erb +1 -1
  45. data/app/views/spree/shared/_google_analytics.html.erb +17 -16
  46. data/app/views/spree/shared/_head.html.erb +0 -3
  47. data/app/views/spree/shared/_order_details.html.erb +2 -3
  48. data/app/views/spree/shipment_mailer/shipped_email.text.erb +7 -7
  49. data/config/initializers/check_for_orphaned_preferences.rb +1 -1
  50. data/config/initializers/rails_5868.rb +8 -0
  51. data/config/locales/en.yml +17 -0
  52. data/config/routes.rb +7 -0
  53. data/db/migrate/20121017010007_remove_not_null_constraint_from_products_on_hand.rb +11 -0
  54. data/lib/generators/spree/dummy/dummy_generator.rb +1 -1
  55. data/lib/generators/spree/dummy/templates/rails/database.yml +1 -1
  56. data/lib/generators/spree/install/templates/app/assets/javascripts/admin/all.js +2 -0
  57. data/lib/spree/core/mail_settings.rb +2 -1
  58. data/lib/spree/core/search/base.rb +5 -2
  59. data/lib/spree/core/testing_support/factories/tax_category_factory.rb +5 -2
  60. data/lib/spree/core/version.rb +1 -1
  61. data/lib/spree/product_filters.rb +1 -1
  62. metadata +41 -42
  63. data/app/helpers/spree/account_helper.rb +0 -4
  64. data/app/helpers/spree/orders_helper.rb +0 -5
  65. data/app/helpers/spree/trackers_helper.rb +0 -4
  66. data/config/initializers/workarounds_for_ruby19.rb +0 -72
  67. data/lib/spree/core/relation_serialization.rb +0 -9
  68. data/lib/spree/core/testing_support/env.rb +0 -2
@@ -20,8 +20,8 @@
20
20
  <% elsif units.select(&:shipped?).empty? %>
21
21
  0
22
22
  <% else %>
23
- <%= text_field_tag "return_quantity[#{variant.id}]",
24
- @return_authorization.inventory_units.group_by(&:variant)[variant].try(:size) || 0, {:style => 'width:30px;'} %>
23
+ <%= number_field_tag "return_quantity[#{variant.id}]",
24
+ @return_authorization.inventory_units.group_by(&:variant)[variant].try(:size) || 0, {:style => 'width:50px;', :min => 0} %>
25
25
  <% end %>
26
26
  </td>
27
27
  </tr>
@@ -33,7 +33,7 @@
33
33
  <% if @return_authorization.received? %>
34
34
  <%= number_to_currency @return_authorization.amount %>
35
35
  <% else %>
36
- <%= f.text_field :amount, {:style => 'width:80px;'} %> <%= t(:rma_value) %>: <span id="rma_value"></span>
36
+ <%= f.text_field :amount, {:style => 'width:80px;'} %> <%= t(:rma_value) %>: <span id="rma_value">0.00</span>
37
37
  <%= f.error_message_on :amount %>
38
38
  <% end %>
39
39
  <% end %>
@@ -45,35 +45,19 @@
45
45
  <% end %>
46
46
 
47
47
 
48
- <% content_for :head do %>
49
- <%= javascript_tag do -%>
50
- var variant_prices = new Array();
51
- <% @return_authorization.order.inventory_units.group_by(&:variant).each do | variant, units| %>
52
- variant_prices[<%= variant.id.to_s %>] = <%= variant.price %>;
53
- <% end %>
54
-
55
- function calculate_rma_price(object, value){
56
- var rma_amount = 0;
57
-
58
- $.each($("td.return_quantity input"), function(i, inpt){
59
- var variant_id = $(inpt).attr('id').replace("return_quantity_", "");
60
- rma_amount += variant_prices[variant_id] * $(inpt).val()
61
- });
48
+ <script>
49
+ $(document).ready(function(){
50
+ var rma_amount = 0;
51
+ $("td.return_quantity input").on('change', function() {
52
+ var rma_amount = 0;
53
+ $.each($("td.return_quantity input"), function(i, input) {
54
+ var variant_id = $(input).attr('id').replace("return_quantity_", "");
55
+ rma_amount += variant_prices[variant_id] * $(input).val()
56
+ });
62
57
 
63
- if(!isNaN(rma_amount)){
64
- $("span#rma_value").html(rma_amount.toFixed(2));
65
- }
58
+ if(!isNaN(rma_amount)){
59
+ $("span#rma_value").html(rma_amount.toFixed(2));
66
60
  }
67
-
68
- $(document).ready(function(){
69
- $.each($("td.return_quantity input"), function(i, inpt){
70
- $(inpt).delayedObserver(function() {
71
- calculate_rma_price();
72
- }, 0.5);
73
- });
74
-
75
- calculate_rma_price();
76
- });
77
- <% end -%>
78
- <% end %>
79
- </div>
61
+ })
62
+ });
63
+ </script>
@@ -6,21 +6,8 @@
6
6
  <%= stylesheet_link_tag 'admin/all' %>
7
7
  <%= javascript_include_tag 'admin/all' %>
8
8
 
9
- <%= javascript_tag do %>
10
- var Spree = {
11
- routes: <%== {
12
- :product_search => spree.admin_products_path(:format => 'json'),
13
- :product_search_basic => spree.admin_products_path(:format => 'json', :json_format => 'basic', :limit => 10),
14
- :user_search => spree.admin_users_path(:format => 'json', :limit => 10)
15
- }.to_json %>,
16
-
17
- strings: {
18
- no_results: '<%== t(:no_results) %>',
19
- type_to_search: '<%== t(:type_to_search) %>',
20
- searching: '<%== t(:searching) %>'
21
- }
22
- }
23
- <% end %>
9
+ <%= render "spree/admin/shared/translations" %>
10
+ <%= render "spree/admin/shared/routes" %>
24
11
 
25
12
  <%= javascript_tag do -%>
26
13
  jQuery.alerts.dialogClass = 'spree';
@@ -26,7 +26,7 @@
26
26
  <% @order.adjustments.eligible.each do |adjustment| %>
27
27
  <% next if (adjustment.originator_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
28
28
  <tr class="total">
29
- <td colspan="3"><strong><%= adjustment.label %></strong></td>
29
+ <td colspan="3"><strong><%= adjustment.label %>:</strong></td>
30
30
  <td class="total"><span><%= number_to_currency adjustment.amount %></span></td>
31
31
  </tr>
32
32
  <% end %>
@@ -0,0 +1,8 @@
1
+ <script>
2
+ Spree.routes = <%== {
3
+ :product_search => spree.admin_products_path(:format => 'json'),
4
+ :product_search_basic => spree.admin_products_path(:format => 'json', :json_format => 'basic', :limit => 10),
5
+ :user_search => spree.admin_users_path(:format => 'json', :limit => 10)
6
+ }.to_json
7
+ %>
8
+ </script>
@@ -0,0 +1,17 @@
1
+ <script>
2
+ Spree.translations = <%==
3
+ { :date_picker => I18n.t(:format,
4
+ :scope => 'spree.date_picker',
5
+ :default => 'yy/mm/dd'),
6
+ :abbr_day_names => I18n.t(:abbr_day_names, :scope => :date),
7
+ :month_names => I18n.t(:month_names, :scope => :date).delete_if(&:blank?),
8
+ :previous => I18n.t(:previous),
9
+ :next => I18n.t(:next),
10
+ :no_results => I18n.t(:no_results),
11
+ :type_to_search => I18n.t(:type_to_search),
12
+ :searching => I18n.t(:searching),
13
+ :sku => I18n.t(:sku),
14
+ :on_hand => I18n.t(:on_hand)
15
+ }.to_json
16
+ %>
17
+ </script>
@@ -21,8 +21,8 @@
21
21
  <tbody>
22
22
  <% @tax_rates.each do |tax_rate|%>
23
23
  <tr id="<%= spree_dom_id tax_rate %>" data-hook="rate_row">
24
- <td><%=tax_rate.zone.name %></td>
25
- <td><%=tax_rate.tax_category.try(:name) || "N/A" %></td>
24
+ <td><%=tax_rate.zone.try(:name) || t(:not_available) %></td>
25
+ <td><%=tax_rate.tax_category.try(:name) || t(:not_available) %></td>
26
26
  <td><%=tax_rate.amount %></td>
27
27
  <td><%=tax_rate.included_in_price %></td>
28
28
  <td><%=tax_rate.calculator.to_s %></td>
@@ -21,10 +21,10 @@
21
21
  <%= f.text_field :sku %></p>
22
22
 
23
23
  <p data-hook="price"><%= f.label :price, t(:price) %>:<br />
24
- <%= f.text_field :price, :value => number_with_precision(@variant.price, :precision => 2) %></p>
24
+ <%= f.text_field :price, :value => number_to_currency(@variant.price, :unit => '') %></p>
25
25
 
26
26
  <p data-hook="cost_price"><%= f.label :cost_price, t(:cost_price) %>:<br />
27
- <%= f.text_field :cost_price, :value => number_with_precision(@variant.cost_price, :precision => 2) %></p>
27
+ <%= f.text_field :cost_price, :value => number_to_currency(@variant.cost_price, :unit => '') %></p>
28
28
 
29
29
  <% if Spree::Config[:track_inventory_levels] %>
30
30
  <p data-hook="on_hand"><%= f.label :on_hand, t(:on_hand) %>: <br />
@@ -19,7 +19,7 @@
19
19
  <%= select_year(Date.today, :prefix => param_prefix, :field_name => 'year', :start_year => Date.today.year, :end_year => Date.today.year + 15, :class => 'required') %>
20
20
  <span class="required">*</span>
21
21
  </p>
22
- <p class="field" data-hook="cart_code">
22
+ <p class="field" data-hook="card_code">
23
23
  <%= label_tag nil, t(:card_code) %><br />
24
24
  <%= text_field_tag "#{param_prefix}[verification_value]", '', options_hash.merge(:id => 'card_code', :class => 'required', :size => 5) %>
25
25
  <span class="required">*</span>
@@ -1,16 +1,16 @@
1
- Dear Customer,
1
+ <%= t('order_mailer.cancel_email.dear_customer') %>
2
2
 
3
- Your order has been CANCELED. Please retain this cancellation information for your records.
3
+ <%= t('order_mailer.cancel_email.instructions') %>
4
4
 
5
5
  ============================================================
6
- Order Summary [CANCELED]
6
+ <%= t('order_mailer.cancel_email.order_summary_canceled') %>
7
7
  ============================================================
8
8
  <% @order.line_items.each do |item| %>
9
9
  <%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%> (<%=item.quantity%>) @ <%= number_to_currency item.price %> = <%= number_to_currency(item.price * item.quantity) %>
10
10
  <% end %>
11
11
  ============================================================
12
- Subtotal: <%= number_to_currency @order.item_total %>
12
+ <%= t('order_mailer.cancel_email.subtotal') %> <%= number_to_currency @order.item_total %>
13
13
  <% @order.adjustments.eligible.each do |adjustment| %>
14
14
  <%= raw(adjustment.label) %> <%= number_to_currency(adjustment.amount) %>
15
15
  <% end %>
16
- Order Total: <%= number_to_currency(@order.total) %>
16
+ <%= t('order_mailer.cancel_email.total') %> <%= number_to_currency(@order.total) %>
@@ -1,19 +1,20 @@
1
- Dear Customer,
1
+ <%= t('order_mailer.confirm_email.dear_customer') %>
2
2
 
3
- Please review and retain the following order information for your records.
3
+ <%= t('order_mailer.confirm_email.instructions') %>
4
4
 
5
5
  ============================================================
6
- Order Summary
6
+ <%= t('order_mailer.confirm_email.order_summary') %>
7
7
  ============================================================
8
8
  <% @order.line_items.each do |item| %>
9
9
  <%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%> (<%=item.quantity%>) @ <%= number_to_currency item.price %> = <%= number_to_currency(item.price * item.quantity) %>
10
10
  <% end %>
11
11
  ============================================================
12
- Subtotal: <%= number_to_currency @order.item_total %>
12
+ <%= t('order_mailer.confirm_email.subtotal') %>: <%= number_to_currency @order.item_total %>
13
+
13
14
  <% @order.adjustments.eligible.each do |adjustment| %>
14
15
  <%= raw(adjustment.label) %> <%= number_to_currency(adjustment.amount) %>
15
16
  <% end %>
16
- Order Total: <%= number_to_currency(@order.total) %>
17
17
 
18
+ <%= t('order_mailer.confirm_email.total') %>: <%= number_to_currency(@order.total) %>
18
19
 
19
- Thank you for your business.
20
+ <%= t('order_mailer.confirm_email.thanks') %>
@@ -1,5 +1,5 @@
1
1
  <!-- no need for thumnails unless there is more then one image -->
2
- <% if product.images.size > 1 %>
2
+ <% if product.images.size > 1 || product.variant_images.size > 0 %>
3
3
  <ul id="product-thumbnails" class="thumbnails inline" data-hook>
4
4
  <% product.images.each do |i| %>
5
5
  <li class="tmb-all" id="tmb-<%= i.id.to_s %>"><%= link_to image_tag(i.attachment.url(:mini)), i.attachment.url(:product) %></li>
@@ -6,27 +6,28 @@
6
6
  _gaq.push(['_trackPageview']);
7
7
 
8
8
  <% if flash[:commerce_tracking] %>
9
- <%# report e-commerce transaction information when applicable %>
9
+ <%# more info: https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiEcommerce %>
10
10
  _gaq.push(['_addTrans',
11
- "<%= @order.number %>", <%# Order Number %>
12
- "", <%# Affiliation %>
13
- "<%= @order.total %>", <%# Order total %>
14
- "<%= @order.adjustments.tax.sum(:amount) %>", <%# Tax Amount %>
15
- "<%= @order.adjustments.shipping.sum(:amount) %>",<%# Ship Amount %>
16
- "", <%# City %>
17
- "", <%# State %>
18
- "" <%# Country %>
11
+ "<%= @order.number %>",
12
+ "",
13
+ "<%= @order.total %>",
14
+ "<%= @order.adjustments.tax.sum(:amount) %>",
15
+ "<%= @order.adjustments.shipping.sum(:amount) %>",
16
+ "<%= @order.bill_address.city %>",
17
+ "<%= @order.bill_address.state_text %>",
18
+ "<%= @order.bill_address.country.name %>"
19
19
  ]);
20
20
  <% @order.line_items.each do |line_item| %>
21
21
  _gaq.push(['_addItem',
22
- "<%= @order.number %>", <%# order ID - required %>
23
- "<%= line_item.variant.sku %>", <%# SKU/code - required %>
24
- "<%= line_item.variant.product.name %>",<%# product name %>
25
- "", <%# category or variation, Product Category %>
26
- "<%= line_item.price %>", <%# unit price - required %>
27
- "<%= line_item.quantity %>" <%# quantity - required %>
22
+ "<%= @order.number %>",
23
+ "<%= line_item.variant.sku %>",
24
+ "<%= line_item.variant.product.name %>",
25
+ "",
26
+ "<%= line_item.price %>",
27
+ "<%= line_item.quantity %>"
28
28
  ]);
29
29
  <% end %>
30
+ _gaq.push(['_trackTrans']);
30
31
  <% end %>
31
32
 
32
33
  (function() {
@@ -35,4 +36,4 @@
35
36
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
36
37
  })();
37
38
  <% end %>
38
- <% end %>
39
+ <% end %>
@@ -1,8 +1,5 @@
1
1
  <meta charset="utf-8">
2
2
 
3
- <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
4
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
5
-
6
3
  <title><%= title %></title>
7
4
 
8
5
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
@@ -1,5 +1,4 @@
1
1
  <div class="row steps-data">
2
-
3
2
  <div class="columns alpha four">
4
3
  <h6><%= t(:shipping_address) %> <%= link_to "(#{t(:edit)})", checkout_state_path(:address) unless @order.completed? %></h6>
5
4
  <div class="address">
@@ -71,7 +70,7 @@
71
70
  <td data-hook="order_item_description">
72
71
  <h4><%= item.variant.product.name %></h4>
73
72
  <%= truncate(item.variant.product.description, :length => 100, :omission => "...") %>
74
- <%= "(" + variant_options(item.variant) + ")" unless item.variant .option_values.empty? %>
73
+ <%= "(" + item.variant.options_text + ")" unless item.variant.option_values.empty? %>
75
74
  </td>
76
75
  <td data-hook="order_item_price" class="price"><span><%= number_to_currency item.price %></span></td>
77
76
  <td data-hook="order_item_qty"><%= item.quantity %></td>
@@ -110,4 +109,4 @@
110
109
  </tr>
111
110
  <% end %>
112
111
  </tfoot>
113
- </table>
112
+ </table>
@@ -1,15 +1,15 @@
1
- Dear Customer,
1
+ <%= t('shipment_mailer.shipped_email.dear_customer') %>
2
2
 
3
- Your order has been shipped
3
+ <%= t('shipment_mailer.shipped_email.instructions') %>
4
4
 
5
5
  ============================================================
6
- Shipment Summary
6
+ <%= t('shipment_mailer.shipped_email.shipment_summary') %>
7
7
  ============================================================
8
- <% @shipment.line_items.each do |item| %>
9
- <%= item.variant.sku %> <%= item.variant.product.name %> <%= variant_options(item.variant) %> (<%= item.quantity %>)
8
+ <% @shipment.manifest.each do |item| %>
9
+ <%= item.variant.sku %> <%= item.variant.product.name %> <%= variant_options(item.variant) %> (<%= item.quantity %>)
10
10
  <% end %>
11
11
  ============================================================
12
12
 
13
- <%= "Tracking Information: #{@shipment.tracking}" if @shipment.tracking %>
13
+ <%= t('shipment_mailer.shipped_email.track_information', :tracking => @shipment.tracking) if @shipment.tracking %>
14
14
 
15
- Thank you for your business.
15
+ <%= t('shipment_mailer.shipped_email.thanks') %>
@@ -1,5 +1,5 @@
1
1
  begin
2
- ActiveRecord::Base.connection.execute("select owner_id, owner_type, name, value from spree_preferences where `key` is null").each do |pref|
2
+ ActiveRecord::Base.connection.execute("SELECT owner_id, owner_type, name, value FROM spree_preferences WHERE 'key' IS NULL").each do |pref|
3
3
  warn "[WARNING] Orphaned preference `#{pref[2]}` with value `#{pref[3]}` for #{pref[1]} with id of: #{pref[0]}, you should reset the preference value manually."
4
4
  end
5
5
  rescue
@@ -0,0 +1,8 @@
1
+ # Temporary fix for
2
+ # NoMethodError: undefined method `gsub' for #<Arel::Nodes::Ascending:...>
3
+ # See https://github.com/rails/rails/issues/5868
4
+ class Arel::Nodes::Ordering
5
+ def gsub(*a, &b)
6
+ to_sql.gsub(*a, &b)
7
+ end
8
+ end
@@ -603,8 +603,19 @@ en:
603
603
  order_mailer:
604
604
  confirm_email:
605
605
  subject: "Order Confirmation"
606
+ dear_customer: "Dear Customer,"
607
+ instructions: "Please review and retain the following order information for your records."
608
+ order_summary: "Order Summary"
609
+ subtotal: "Subtotal:"
610
+ total: "Order Total:"
611
+ thanks: "Thank you for your business."
606
612
  cancel_email:
607
613
  subject: "Cancellation of Order"
614
+ dear_customer: "Dear Customer,"
615
+ instructions: "Your order has been CANCELED. Please retain this cancellation information for your records."
616
+ order_summary_canceled: "Order Summary [CANCELED]"
617
+ subtotal: "Subtotal:"
618
+ total: "Order Total:"
608
619
  order_not_in_system: That order number is not valid on this site.
609
620
  order_number: Order
610
621
  order_operation_authorize: Authorize
@@ -679,6 +690,7 @@ en:
679
690
  please_create_user: "Please create a user account"
680
691
  please_define_payment_methods: "Please define some payment methods first."
681
692
  powered_by: "Powered by"
693
+ populate_get_error: "Something went wrong. Please try adding the item again."
682
694
  presentation: Presentation
683
695
  preview: Preview
684
696
  previous: Previous
@@ -892,6 +904,11 @@ en:
892
904
  shipment_mailer:
893
905
  shipped_email:
894
906
  subject: "Shipment Notification"
907
+ dear_customer: "Dear Customer,"
908
+ instructions: "Your order has been shipped"
909
+ shipment_summary: "Shipment Summary"
910
+ track_information: "Tracking Information: %{tracking}"
911
+ thanks: "Thank you for your business."
895
912
  shipment_number: "Shipment #"
896
913
  shipment_state: Shipment State
897
914
  shipment_states:
data/config/routes.rb CHANGED
@@ -15,6 +15,13 @@ Spree::Core::Engine.routes.draw do
15
15
  match '/checkout/:state', :to => 'checkout#edit', :as => :checkout_state, :via => :get
16
16
  match '/checkout', :to => 'checkout#edit', :state => 'address', :as => :checkout, :via => :get
17
17
 
18
+ populate_redirect = redirect do |params, request|
19
+ request.flash[:error] = I18n.t(:populate_get_error)
20
+ request.referer || '/cart'
21
+ end
22
+
23
+ get '/orders/populate', :via => :get, :to => populate_redirect
24
+
18
25
  resources :orders do
19
26
  post :populate, :on => :collection
20
27
 
@@ -0,0 +1,11 @@
1
+ class RemoveNotNullConstraintFromProductsOnHand < ActiveRecord::Migration
2
+ def up
3
+ change_column :spree_products, :count_on_hand, :integer, :null => true
4
+ change_column :spree_variants, :count_on_hand, :integer, :null => true
5
+ end
6
+
7
+ def down
8
+ change_column :spree_products, :count_on_hand, :integer, :null => false
9
+ change_column :spree_variants, :count_on_hand, :integer, :null => false
10
+ end
11
+ end
@@ -1,7 +1,7 @@
1
1
  require "rails/generators/rails/app/app_generator"
2
2
 
3
3
  module Spree
4
- class DummyGenerator < Rails::Generators::Base
4
+ class DummyGenerator < Rails::Generators::Base
5
5
  desc "Creates blank Rails application, installs Spree and all sample data"
6
6
 
7
7
  class_option :lib_name, :default => ''
@@ -28,7 +28,7 @@ production:
28
28
  <% when 'postgres' %>
29
29
  development:
30
30
  adapter: postgresql
31
- database: spree_test
31
+ database: spree_development
32
32
  username: postgres
33
33
  min_messages: warning
34
34
  test:
@@ -4,6 +4,8 @@
4
4
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
5
  // the compiled file.
6
6
  //
7
+ //= require jquery
8
+ //= require jquery_ujs
7
9
  <% if options[:lib_name] == 'spree' %>
8
10
  //= require admin/spree_core
9
11
  //= require admin/spree_auth