spree_core 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/stylesheets/store/screen.css.scss +5 -0
- data/app/controllers/spree/admin/tax_settings_controller.rb +1 -1
- data/app/controllers/spree/orders_controller.rb +11 -25
- data/app/models/spree/image.rb +1 -1
- data/app/models/spree/line_item.rb +1 -1
- data/app/models/spree/order_populator.rb +68 -0
- data/app/views/spree/address/_form.html.erb +1 -1
- data/app/views/spree/admin/image_settings/edit.html.erb +8 -1
- data/app/views/spree/admin/return_authorizations/_form.html.erb +4 -4
- data/app/views/spree/admin/shared/_order_details.html.erb +1 -1
- data/app/views/spree/admin/tax_settings/edit.html.erb +2 -1
- data/app/views/spree/checkout/payment/_gateway.html.erb +3 -6
- data/app/views/spree/products/_thumbnails.html.erb +17 -15
- data/app/views/spree/products/show.html.erb +1 -1
- data/config/locales/en.yml +3 -12
- data/config/routes.rb +1 -18
- data/db/migrate/20121031162139_split_prices_from_variants.rb +6 -5
- data/lib/spree/core/controller_helpers/order.rb +1 -1
- data/lib/spree/core/testing_support/factories/payment_factory.rb +0 -17
- data/lib/spree/core/testing_support/factories/product_factory.rb +3 -0
- data/lib/spree/core/validators/email.rb +1 -1
- data/lib/spree/core/version.rb +1 -1
- data/lib/tasks/taxon.rake +1 -1
- metadata +142 -51
@@ -488,6 +488,10 @@ mark {background-color: $link_text_color; color: $layout_background_color; font-
|
|
488
488
|
border-color: $link_text_color;
|
489
489
|
}
|
490
490
|
|
491
|
+
img {
|
492
|
+
max-width: 100%; /* Fluid images for product */
|
493
|
+
}
|
494
|
+
|
491
495
|
}
|
492
496
|
|
493
497
|
.price {
|
@@ -542,6 +546,7 @@ mark {background-color: $link_text_color; color: $layout_background_color; font-
|
|
542
546
|
|
543
547
|
img {
|
544
548
|
min-height: 240px;
|
549
|
+
max-width: 100%; /* Fluid images for product */
|
545
550
|
}
|
546
551
|
}
|
547
552
|
#product-thumbnails {
|
@@ -39,32 +39,18 @@ module Spree
|
|
39
39
|
end
|
40
40
|
|
41
41
|
# Adds a new item to the order (creating a new order if none already exists)
|
42
|
-
#
|
43
|
-
# Parameters can be passed using the following possible parameter configurations:
|
44
|
-
#
|
45
|
-
# * Single variant/quantity pairing
|
46
|
-
# +:variants => { variant_id => quantity }+
|
47
|
-
#
|
48
|
-
# * Multiple products at once
|
49
|
-
# +:products => { product_id => variant_id, product_id => variant_id }, :quantity => quantity+
|
50
|
-
# +:products => { product_id => variant_id, product_id => variant_id }, :quantity => { variant_id => quantity, variant_id => quantity }+
|
51
42
|
def populate
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end if params[:variants]
|
64
|
-
|
65
|
-
fire_event('spree.cart.add')
|
66
|
-
fire_event('spree.order.contents_changed')
|
67
|
-
respond_with(@order) { |format| format.html { redirect_to cart_path } }
|
43
|
+
populator = OrderPopulator.new(current_order(true), current_currency)
|
44
|
+
if populator.populate(params.slice(:products, :variants, :quantity))
|
45
|
+
fire_event('spree.cart.add')
|
46
|
+
fire_event('spree.order.contents_changed')
|
47
|
+
respond_with(@order) do |format|
|
48
|
+
format.html { redirect_to cart_path }
|
49
|
+
end
|
50
|
+
else
|
51
|
+
flash[:error] = populator.errors.full_messages.join(" ")
|
52
|
+
redirect_to :back
|
53
|
+
end
|
68
54
|
end
|
69
55
|
|
70
56
|
def empty
|
data/app/models/spree/image.rb
CHANGED
@@ -10,7 +10,7 @@ module Spree
|
|
10
10
|
:default_style => :product,
|
11
11
|
:url => '/spree/products/:id/:style/:basename.:extension',
|
12
12
|
:path => ':rails_root/public/spree/products/:id/:style/:basename.:extension',
|
13
|
-
:convert_options => { :all => '-strip' }
|
13
|
+
:convert_options => { :all => '-strip -auto-orient' }
|
14
14
|
# save the w,h of the original image (from which others can be calculated)
|
15
15
|
# we need to look at the write-queue for images which have not been saved yet
|
16
16
|
after_post_process :find_dimensions
|
@@ -2,7 +2,7 @@ module Spree
|
|
2
2
|
class LineItem < ActiveRecord::Base
|
3
3
|
before_validation :adjust_quantity
|
4
4
|
belongs_to :order
|
5
|
-
belongs_to :variant
|
5
|
+
belongs_to :variant, :class_name => "Spree::Variant"
|
6
6
|
|
7
7
|
has_one :product, :through => :variant
|
8
8
|
has_many :adjustments, :as => :adjustable, :dependent => :destroy
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module Spree
|
2
|
+
class OrderPopulator
|
3
|
+
attr_accessor :order, :currency
|
4
|
+
attr_reader :errors
|
5
|
+
|
6
|
+
def initialize(order, currency)
|
7
|
+
@order = order
|
8
|
+
@currency = currency
|
9
|
+
@errors = ActiveModel::Errors.new(self)
|
10
|
+
end
|
11
|
+
|
12
|
+
#
|
13
|
+
# Parameters can be passed using the following possible parameter configurations:
|
14
|
+
#
|
15
|
+
# * Single variant/quantity pairing
|
16
|
+
# +:variants => { variant_id => quantity }+
|
17
|
+
#
|
18
|
+
# * Multiple products at once
|
19
|
+
# +:products => { product_id => variant_id, product_id => variant_id }, :quantity => quantity+
|
20
|
+
# +:products => { product_id => variant_id, product_id => variant_id }, :quantity => { variant_id => quantity, variant_id => quantity }+
|
21
|
+
def populate(from_hash)
|
22
|
+
from_hash[:products].each do |product_id,variant_id|
|
23
|
+
attempt_cart_add(variant_id, from_hash[:quantity])
|
24
|
+
end if from_hash[:products]
|
25
|
+
|
26
|
+
from_hash[:variants].each do |variant_id, quantity|
|
27
|
+
attempt_cart_add(variant_id, quantity)
|
28
|
+
end if from_hash[:variants]
|
29
|
+
|
30
|
+
valid?
|
31
|
+
end
|
32
|
+
|
33
|
+
def valid?
|
34
|
+
errors.empty?
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def attempt_cart_add(variant_id, quantity)
|
40
|
+
quantity = quantity.to_i
|
41
|
+
variant = Spree::Variant.find(variant_id)
|
42
|
+
if quantity > 0
|
43
|
+
if check_stock_levels(variant, quantity)
|
44
|
+
@order.add_variant(variant, quantity, currency)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def check_stock_levels(variant, quantity)
|
50
|
+
display_name = %Q{#{variant.name}}
|
51
|
+
display_name += %Q{ (#{variant.options_text})} unless variant.options_text.blank?
|
52
|
+
|
53
|
+
if variant.in_stock?
|
54
|
+
on_hand = variant.on_hand
|
55
|
+
if on_hand >= quantity
|
56
|
+
return true
|
57
|
+
else
|
58
|
+
errors.add(:base, %Q{There are only #{on_hand} of #{display_name.inspect} remaining.} +
|
59
|
+
%Q{ Please select a quantity less than or equal to this value.})
|
60
|
+
return false
|
61
|
+
end
|
62
|
+
else
|
63
|
+
errors.add(:base, %Q{#{display_name.inspect} is out of stock.})
|
64
|
+
return false
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -19,13 +19,20 @@
|
|
19
19
|
<%= preference_field_tag 'preferences[attachment_path]', Spree::Config[:attachment_path], :type => :string %>
|
20
20
|
</div>
|
21
21
|
|
22
|
-
|
23
22
|
<div class="alpha eight columns">
|
24
23
|
<div data-hook="attachment_default_url" class="field">
|
25
24
|
<%= label_tag 'preferences[attachment_default_url]', t(:attachment_default_url) %>
|
26
25
|
<%= preference_field_tag 'preferences[attachment_default_url]', Spree::Config[:attachment_default_url], :type => :string %>
|
27
26
|
</div>
|
28
27
|
</div>
|
28
|
+
|
29
|
+
<div class="alpha eight columns">
|
30
|
+
<div data-hook="attachment_url" class="field">
|
31
|
+
<%= label_tag 'preferences[attachment_url]', t(:attachment_url) %>
|
32
|
+
<%= preference_field_tag 'preferences[attachment_url]', Spree::Config[:attachment_url], :type => :string %>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
29
36
|
<div class="omega four columns">
|
30
37
|
<div data-hook="attachment_default_style" class="field">
|
31
38
|
<%= label_tag 'preferences[attachment_default_style]', t(:attachment_default_style) %>
|
@@ -50,9 +50,9 @@
|
|
50
50
|
</div>
|
51
51
|
|
52
52
|
<script>
|
53
|
-
var
|
54
|
-
<% @return_authorization.order.
|
55
|
-
|
53
|
+
var line_item_prices = {};
|
54
|
+
<% @return_authorization.order.line_items.group_by(&:variant).each do | variant, items| %>
|
55
|
+
line_item_prices[<%= variant.id.to_s %>] = <%= items.first.price %>;
|
56
56
|
<% end %>
|
57
57
|
|
58
58
|
$(document).ready(function(){
|
@@ -61,7 +61,7 @@
|
|
61
61
|
var rma_amount = 0;
|
62
62
|
$.each($("td.return_quantity input"), function(i, input) {
|
63
63
|
var variant_id = $(input).attr('id').replace("return_quantity_", "");
|
64
|
-
rma_amount +=
|
64
|
+
rma_amount += line_item_prices[variant_id] * $(input).val()
|
65
65
|
});
|
66
66
|
|
67
67
|
if(!isNaN(rma_amount)){
|
@@ -20,7 +20,7 @@
|
|
20
20
|
<tbody id="subtotal" data-hook="order_details_subtotal" class="with-border">
|
21
21
|
<tr class="total" id="subtotal-row">
|
22
22
|
<td colspan="3"><b><%= t(:subtotal) %>:</b></td>
|
23
|
-
<td class="total"><span><%= @order.
|
23
|
+
<td class="total"><span><%= @order.display_item_total %></span></td>
|
24
24
|
</tr>
|
25
25
|
</tbody>
|
26
26
|
<tbody id="order-charges" data-hook="order_details_adjustments" class="with-border">
|
@@ -6,9 +6,10 @@
|
|
6
6
|
|
7
7
|
<%= form_tag admin_tax_settings_path, :method => :put do %>
|
8
8
|
<div data-hook="shipment_vat" class="field align-center">
|
9
|
+
<%= hidden_field_tag 'preferences[shipment_inc_vat]', '0' %>
|
9
10
|
<%= check_box_tag 'preferences[shipment_inc_vat]', '1', Spree::Config[:shipment_inc_vat] %>
|
10
11
|
<%= label_tag nil, t(:shipment_inc_vat) %>
|
11
|
-
|
12
|
+
|
12
13
|
</div>
|
13
14
|
|
14
15
|
<div class="form-buttons" data-hook="buttons">
|
@@ -2,10 +2,9 @@
|
|
2
2
|
<% param_prefix = "payment_source[#{payment_method.id}]" %>
|
3
3
|
|
4
4
|
<p class="field" data-hook="card_number">
|
5
|
-
<%= label_tag nil, t(:card_number) %><br />
|
5
|
+
<%= label_tag nil, t(:card_number) %><span class="required">*</span><br />
|
6
6
|
<% options_hash = Rails.env.production? ? {:autocomplete => 'off'} : {} %>
|
7
7
|
<%= text_field_tag "#{param_prefix}[number]", '', options_hash.merge(:id => 'card_number', :class => 'required', :size => 19, :maxlength => 19, :autocomplete => "off") %>
|
8
|
-
<span class="required">*</span>
|
9
8
|
|
10
9
|
<span id="card_type" style="display:none;">
|
11
10
|
( <span id="looks_like" ><%= t(:card_type_is) %> <span id="type"></span></span>
|
@@ -14,15 +13,13 @@
|
|
14
13
|
</span>
|
15
14
|
</p>
|
16
15
|
<p class="field" data-hook="card_expiration">
|
17
|
-
<%= label_tag nil, t(:expiration) %><br />
|
16
|
+
<%= label_tag nil, t(:expiration) %><span class="required">*</span><br />
|
18
17
|
<%= select_month(Date.today, { :prefix => param_prefix, :field_name => 'month', :use_month_numbers => true }, :class => 'required') %>
|
19
18
|
<%= select_year(Date.today, { :prefix => param_prefix, :field_name => 'year', :start_year => Date.today.year, :end_year => Date.today.year + 15 }, :class => 'required') %>
|
20
|
-
<span class="required">*</span>
|
21
19
|
</p>
|
22
20
|
<p class="field" data-hook="card_code">
|
23
|
-
<%= label_tag nil, t(:card_code) %><br />
|
21
|
+
<%= label_tag nil, t(:card_code) %><span class="required">*</span><br />
|
24
22
|
<%= text_field_tag "#{param_prefix}[verification_value]", '', options_hash.merge(:id => 'card_code', :class => 'required', :size => 5) %>
|
25
|
-
<span class="required">*</span>
|
26
23
|
<%= link_to "(#{t(:whats_this)})", spree.content_path('cvv'), :target => '_blank', :onclick => "window.open(this.href,'cvv_info','left=20,top=20,width=500,height=500,toolbar=0,resizable=0,scrollbars=1');return false", "data-hook" => "cvv_link" %>
|
27
24
|
</p>
|
28
25
|
<%= hidden_field param_prefix, 'first_name', :value => @order.billing_firstname %>
|
@@ -1,19 +1,21 @@
|
|
1
|
-
|
2
|
-
<% if product.images
|
1
|
+
<%# no need for thumbnails unless there is more than one image %>
|
2
|
+
<% if (@product.images + @product.variant_images).uniq.size > 1 %>
|
3
3
|
<ul id="product-thumbnails" class="thumbnails inline" data-hook>
|
4
|
-
<% product.images.each do |i| %>
|
5
|
-
<li class=
|
4
|
+
<% @product.images.each do |i| %>
|
5
|
+
<li class='tmb-all' id='tmb-<%= i.id %>'>
|
6
|
+
<%= link_to(image_tag(i.attachment.url(:mini)), i.attachment.url(:product), :class => 'tmb-all', :id => "tmb-#{i.id}") %>
|
7
|
+
</li>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<% if @product.has_variants? %>
|
11
|
+
<% @variants.select(&:available?).each do |v| %>
|
12
|
+
<% v.images.each do |i| %>
|
13
|
+
<% next if @product.images.include?(i) %>
|
14
|
+
<li class='vtmb-<%= v.id %> vtmb' id='tmb-<%= i.id %>'>
|
15
|
+
<%= link_to(image_tag(i.attachment.url(:mini)), i.attachment.url(:product)) %>
|
16
|
+
</li>
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
6
19
|
<% end %>
|
7
|
-
<% if @product.has_variants?
|
8
|
-
@variants.each do |v|
|
9
|
-
if v.available?
|
10
|
-
v.images.each do |i| %>
|
11
|
-
<li class="vtmb-<%= v.id.to_s %> vtmb" id="tmb-<%= i.id.to_s %>"><%= link_to image_tag(i.attachment.url(:mini)), i.attachment.url(:product) %></li>
|
12
|
-
<%
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
%>
|
18
20
|
</ul>
|
19
21
|
<% end %>
|
data/config/locales/en.yml
CHANGED
@@ -260,9 +260,10 @@ en:
|
|
260
260
|
assign_taxon: "Assign Taxon"
|
261
261
|
assign_taxons: "Assign Taxons"
|
262
262
|
attachment_default_style: "Attachments Style"
|
263
|
-
attachment_default_url: "Attachments URL"
|
263
|
+
attachment_default_url: "Attachments Default URL"
|
264
264
|
attachment_path: "Attachments Path"
|
265
265
|
attachment_styles: "Paperclip Styles"
|
266
|
+
attachment_url: "Attachments URL"
|
266
267
|
authorization_failure: "Authorization Failure"
|
267
268
|
authorized: Authorized
|
268
269
|
availability: "Availability"
|
@@ -413,8 +414,6 @@ en:
|
|
413
414
|
email_server_settings_description: "Set email server settings."
|
414
415
|
empty: "Empty"
|
415
416
|
empty_cart: "Empty Cart"
|
416
|
-
enable_login_via_login_password: "Use standard email/password"
|
417
|
-
enable_login_via_openid: "Use OpenID instead"
|
418
417
|
enable_mail_delivery: Enable Mail Delivery
|
419
418
|
ending_in: "Ending in"
|
420
419
|
enter_exactly_as_shown_on_card: Please enter exactly as shown on the card
|
@@ -496,7 +495,7 @@ en:
|
|
496
495
|
image_settings: "Image Settings"
|
497
496
|
image_settings_description: "Image Settings Description"
|
498
497
|
image_settings_updated: "Image Settings successfully updated."
|
499
|
-
image_settings_warning: "You will need to regenerate thumbnails if you update the paperclip styles. Use rake paperclip:refresh:thumbnails to do this."
|
498
|
+
image_settings_warning: "You will need to regenerate thumbnails if you update the paperclip styles. Use rake paperclip:refresh:thumbnails CLASS=Spree::Image to do this."
|
500
499
|
in_progress: "In Progress"
|
501
500
|
include_in_shipment: Include in Shipment
|
502
501
|
included_in_other_shipment: Included in another Shipment
|
@@ -534,14 +533,6 @@ en:
|
|
534
533
|
live: "Live"
|
535
534
|
loading: Loading
|
536
535
|
locale_changed: "Locale Changed"
|
537
|
-
logged_in_as: "Logged in as"
|
538
|
-
logged_in_succesfully: "Logged in successfully"
|
539
|
-
logged_out: "You have been logged out."
|
540
|
-
login: Login
|
541
|
-
login_as_existing: "Login as Existing Customer"
|
542
|
-
login_failed: "Login authentication failed."
|
543
|
-
login_name: Login
|
544
|
-
logout: Logout
|
545
536
|
look_for_similar_items: Look for similar items
|
546
537
|
maestro_or_solo_cards: Maestro/Solo cards
|
547
538
|
mail_delivery_enabled: "Mail delivery is enabled"
|
data/config/routes.rb
CHANGED
@@ -6,8 +6,6 @@ Spree::Core::Engine.routes.draw do
|
|
6
6
|
|
7
7
|
match '/locale/set', :to => 'locale#set'
|
8
8
|
|
9
|
-
resources :tax_categories
|
10
|
-
|
11
9
|
resources :states, :only => :index
|
12
10
|
resources :countries, :only => :index
|
13
11
|
|
@@ -25,27 +23,12 @@ Spree::Core::Engine.routes.draw do
|
|
25
23
|
|
26
24
|
resources :orders do
|
27
25
|
post :populate, :on => :collection
|
28
|
-
|
29
|
-
resources :line_items
|
30
|
-
|
31
|
-
resources :shipments do
|
32
|
-
member do
|
33
|
-
get :shipping_method
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
26
|
end
|
27
|
+
|
38
28
|
get '/cart', :to => 'orders#edit', :as => :cart
|
39
29
|
put '/cart', :to => 'orders#update', :as => :update_cart
|
40
30
|
put '/cart/empty', :to => 'orders#empty', :as => :empty_cart
|
41
31
|
|
42
|
-
resources :shipments do
|
43
|
-
member do
|
44
|
-
get :shipping_method
|
45
|
-
put :shipping_method
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
32
|
# route globbing for pretty nested taxon and product paths
|
50
33
|
match '/t/*id', :to => 'taxons#show', :as => :nested_taxons
|
51
34
|
|
@@ -18,13 +18,14 @@ class SplitPricesFromVariants < ActiveRecord::Migration
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def down
|
21
|
-
|
21
|
+
prices = ActiveRecord::Base.connection.execute("select variant_id, amount from spree_prices")
|
22
|
+
add_column :spree_variants, :price, :decimal, :after => :sku, :scale => 2, :precision => 8
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
variant.save!
|
24
|
+
prices.each do |price|
|
25
|
+
ActiveRecord::Base.connection.execute("update spree_variants set price = #{price['amount']} where id = #{price['variant_id']}")
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
|
+
change_column :spree_variants, :price, :decimal, :after => :sku, :scale => 2, :precision => 8, :null => false
|
28
29
|
drop_table :spree_prices
|
29
30
|
end
|
30
31
|
end
|
@@ -27,7 +27,7 @@ module Spree
|
|
27
27
|
@current_order = current_order unless current_order.try(:completed?)
|
28
28
|
end
|
29
29
|
if create_order_if_necessary and (@current_order.nil? or @current_order.completed?)
|
30
|
-
@current_order = Spree::Order.new(currency
|
30
|
+
@current_order = Spree::Order.new(:currency => current_currency)
|
31
31
|
before_save_new_order
|
32
32
|
@current_order.save!
|
33
33
|
after_save_new_order
|
@@ -7,25 +7,8 @@ FactoryGirl.define do
|
|
7
7
|
state 'pending'
|
8
8
|
response_code '12345'
|
9
9
|
|
10
|
-
# limit the payment amount to order's remaining balance, to avoid over-pay exceptions
|
11
|
-
after_create do |pmt|
|
12
|
-
#pmt.update_attribute(:amount, [pmt.amount, pmt.order.outstanding_balance].min)
|
13
|
-
end
|
14
10
|
end
|
15
11
|
|
16
|
-
# factory :creditcard_txn do
|
17
|
-
# payment
|
18
|
-
# amount 45.75
|
19
|
-
# response_code 12345
|
20
|
-
# txn_type CreditcardTxn::TxnType::AUTHORIZE
|
21
|
-
#
|
22
|
-
# # match the payment amount to the payment's value
|
23
|
-
# after_create do |txn|
|
24
|
-
# # txn.update_attribute(:amount, [txn.amount, txn.payment.payment].min)
|
25
|
-
# txn.update_attribute(:amount, txn.payment.amount)
|
26
|
-
# end
|
27
|
-
# end
|
28
|
-
|
29
12
|
factory :check_payment, :class => Spree::Payment do
|
30
13
|
amount 45.75
|
31
14
|
payment_method { FactoryGirl.create(:payment_method) }
|
@@ -7,11 +7,13 @@ FactoryGirl.define do
|
|
7
7
|
sku 'ABC'
|
8
8
|
available_on 1.year.ago
|
9
9
|
deleted_at nil
|
10
|
+
on_hand 5
|
10
11
|
end
|
11
12
|
|
12
13
|
factory :product, :parent => :simple_product do
|
13
14
|
tax_category { |r| Spree::TaxCategory.first || r.association(:tax_category) }
|
14
15
|
shipping_category { |r| Spree::ShippingCategory.first || r.association(:shipping_category) }
|
16
|
+
on_hand 5
|
15
17
|
end
|
16
18
|
|
17
19
|
factory :product_with_option_types, :parent => :product do
|
@@ -22,6 +24,7 @@ FactoryGirl.define do
|
|
22
24
|
name "Custom Product"
|
23
25
|
price "17.99"
|
24
26
|
description { Faker::Lorem.paragraphs(1 + Kernel.rand(5)).join("\n") }
|
27
|
+
on_hand 5
|
25
28
|
|
26
29
|
# associations:
|
27
30
|
tax_category { |r| Spree::TaxCategory.first || r.association(:tax_category) }
|
@@ -18,6 +18,6 @@ class EmailValidator < ActiveModel::EachValidator
|
|
18
18
|
rescue Exception => e
|
19
19
|
r = false
|
20
20
|
end
|
21
|
-
record.errors[attribute] << (options[:message] || "
|
21
|
+
record.errors[attribute] << (options[:message] || I18n.t("errors.messages.invalid")) unless r
|
22
22
|
end
|
23
23
|
end
|
data/lib/spree/core/version.rb
CHANGED
data/lib/tasks/taxon.rake
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
namespace :spree do
|
2
2
|
desc "Resets all taxon permalinks"
|
3
3
|
task :reset_taxon_permalinks => :environment do
|
4
|
-
Taxon.where(:parent_id => nil).each {|taxon| redo_permalinks(taxon) }
|
4
|
+
Spree::Taxon.where(:parent_id => nil).each {|taxon| redo_permalinks(taxon) }
|
5
5
|
end
|
6
6
|
|
7
7
|
def redo_permalinks(taxon)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,33 +9,43 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: acts_as_list
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- - =
|
19
|
+
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 0.1.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - '='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.1.4
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: awesome_nested_set
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
|
-
- - =
|
35
|
+
- - '='
|
31
36
|
- !ruby/object:Gem::Version
|
32
37
|
version: 2.1.5
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - '='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.1.5
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: jquery-rails
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ~>
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '2.0'
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: select2-rails
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ~>
|
@@ -54,32 +69,47 @@ dependencies:
|
|
54
69
|
version: '3.2'
|
55
70
|
type: :runtime
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '3.2'
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: highline
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
|
-
- - =
|
83
|
+
- - '='
|
64
84
|
- !ruby/object:Gem::Version
|
65
85
|
version: 1.6.11
|
66
86
|
type: :runtime
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - '='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.6.11
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: state_machine
|
71
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
72
97
|
none: false
|
73
98
|
requirements:
|
74
|
-
- - =
|
99
|
+
- - '='
|
75
100
|
- !ruby/object:Gem::Version
|
76
101
|
version: 1.1.2
|
77
102
|
type: :runtime
|
78
103
|
prerelease: false
|
79
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - '='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.1.2
|
80
110
|
- !ruby/object:Gem::Dependency
|
81
111
|
name: ffaker
|
82
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
83
113
|
none: false
|
84
114
|
requirements:
|
85
115
|
- - ~>
|
@@ -87,10 +117,15 @@ dependencies:
|
|
87
117
|
version: 1.12.0
|
88
118
|
type: :runtime
|
89
119
|
prerelease: false
|
90
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 1.12.0
|
91
126
|
- !ruby/object:Gem::Dependency
|
92
127
|
name: paperclip
|
93
|
-
requirement:
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
94
129
|
none: false
|
95
130
|
requirements:
|
96
131
|
- - ~>
|
@@ -98,10 +133,15 @@ dependencies:
|
|
98
133
|
version: '2.8'
|
99
134
|
type: :runtime
|
100
135
|
prerelease: false
|
101
|
-
version_requirements:
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ~>
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '2.8'
|
102
142
|
- !ruby/object:Gem::Dependency
|
103
143
|
name: aws-sdk
|
104
|
-
requirement:
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
105
145
|
none: false
|
106
146
|
requirements:
|
107
147
|
- - ~>
|
@@ -109,10 +149,15 @@ dependencies:
|
|
109
149
|
version: 1.3.4
|
110
150
|
type: :runtime
|
111
151
|
prerelease: false
|
112
|
-
version_requirements:
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ~>
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: 1.3.4
|
113
158
|
- !ruby/object:Gem::Dependency
|
114
159
|
name: ransack
|
115
|
-
requirement:
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
116
161
|
none: false
|
117
162
|
requirements:
|
118
163
|
- - ~>
|
@@ -120,43 +165,63 @@ dependencies:
|
|
120
165
|
version: 0.7.2
|
121
166
|
type: :runtime
|
122
167
|
prerelease: false
|
123
|
-
version_requirements:
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ~>
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 0.7.2
|
124
174
|
- !ruby/object:Gem::Dependency
|
125
175
|
name: activemerchant
|
126
|
-
requirement:
|
176
|
+
requirement: !ruby/object:Gem::Requirement
|
127
177
|
none: false
|
128
178
|
requirements:
|
129
|
-
- -
|
179
|
+
- - ~>
|
130
180
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
181
|
+
version: 1.29.3
|
132
182
|
type: :runtime
|
133
183
|
prerelease: false
|
134
|
-
version_requirements:
|
184
|
+
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
186
|
+
requirements:
|
187
|
+
- - ~>
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: 1.29.3
|
135
190
|
- !ruby/object:Gem::Dependency
|
136
191
|
name: rails
|
137
|
-
requirement:
|
192
|
+
requirement: !ruby/object:Gem::Requirement
|
138
193
|
none: false
|
139
194
|
requirements:
|
140
195
|
- - ~>
|
141
196
|
- !ruby/object:Gem::Version
|
142
|
-
version: 3.2.
|
197
|
+
version: 3.2.10
|
143
198
|
type: :runtime
|
144
199
|
prerelease: false
|
145
|
-
version_requirements:
|
200
|
+
version_requirements: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
202
|
+
requirements:
|
203
|
+
- - ~>
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: 3.2.10
|
146
206
|
- !ruby/object:Gem::Dependency
|
147
207
|
name: kaminari
|
148
|
-
requirement:
|
208
|
+
requirement: !ruby/object:Gem::Requirement
|
149
209
|
none: false
|
150
210
|
requirements:
|
151
|
-
- - =
|
211
|
+
- - '='
|
152
212
|
- !ruby/object:Gem::Version
|
153
213
|
version: 0.13.0
|
154
214
|
type: :runtime
|
155
215
|
prerelease: false
|
156
|
-
version_requirements:
|
216
|
+
version_requirements: !ruby/object:Gem::Requirement
|
217
|
+
none: false
|
218
|
+
requirements:
|
219
|
+
- - '='
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: 0.13.0
|
157
222
|
- !ruby/object:Gem::Dependency
|
158
223
|
name: deface
|
159
|
-
requirement:
|
224
|
+
requirement: !ruby/object:Gem::Requirement
|
160
225
|
none: false
|
161
226
|
requirements:
|
162
227
|
- - ! '>='
|
@@ -164,10 +229,15 @@ dependencies:
|
|
164
229
|
version: 0.9.0
|
165
230
|
type: :runtime
|
166
231
|
prerelease: false
|
167
|
-
version_requirements:
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
none: false
|
234
|
+
requirements:
|
235
|
+
- - ! '>='
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
version: 0.9.0
|
168
238
|
- !ruby/object:Gem::Dependency
|
169
239
|
name: stringex
|
170
|
-
requirement:
|
240
|
+
requirement: !ruby/object:Gem::Requirement
|
171
241
|
none: false
|
172
242
|
requirements:
|
173
243
|
- - ~>
|
@@ -175,40 +245,60 @@ dependencies:
|
|
175
245
|
version: 1.3.2
|
176
246
|
type: :runtime
|
177
247
|
prerelease: false
|
178
|
-
version_requirements:
|
248
|
+
version_requirements: !ruby/object:Gem::Requirement
|
249
|
+
none: false
|
250
|
+
requirements:
|
251
|
+
- - ~>
|
252
|
+
- !ruby/object:Gem::Version
|
253
|
+
version: 1.3.2
|
179
254
|
- !ruby/object:Gem::Dependency
|
180
255
|
name: cancan
|
181
|
-
requirement:
|
256
|
+
requirement: !ruby/object:Gem::Requirement
|
182
257
|
none: false
|
183
258
|
requirements:
|
184
|
-
- - =
|
259
|
+
- - '='
|
185
260
|
- !ruby/object:Gem::Version
|
186
261
|
version: 1.6.8
|
187
262
|
type: :runtime
|
188
263
|
prerelease: false
|
189
|
-
version_requirements:
|
264
|
+
version_requirements: !ruby/object:Gem::Requirement
|
265
|
+
none: false
|
266
|
+
requirements:
|
267
|
+
- - '='
|
268
|
+
- !ruby/object:Gem::Version
|
269
|
+
version: 1.6.8
|
190
270
|
- !ruby/object:Gem::Dependency
|
191
271
|
name: money
|
192
|
-
requirement:
|
272
|
+
requirement: !ruby/object:Gem::Requirement
|
193
273
|
none: false
|
194
274
|
requirements:
|
195
|
-
- - =
|
275
|
+
- - '='
|
196
276
|
- !ruby/object:Gem::Version
|
197
277
|
version: 5.0.0
|
198
278
|
type: :runtime
|
199
279
|
prerelease: false
|
200
|
-
version_requirements:
|
280
|
+
version_requirements: !ruby/object:Gem::Requirement
|
281
|
+
none: false
|
282
|
+
requirements:
|
283
|
+
- - '='
|
284
|
+
- !ruby/object:Gem::Version
|
285
|
+
version: 5.0.0
|
201
286
|
- !ruby/object:Gem::Dependency
|
202
287
|
name: rabl
|
203
|
-
requirement:
|
288
|
+
requirement: !ruby/object:Gem::Requirement
|
204
289
|
none: false
|
205
290
|
requirements:
|
206
|
-
- - =
|
291
|
+
- - '='
|
207
292
|
- !ruby/object:Gem::Version
|
208
293
|
version: 0.7.2
|
209
294
|
type: :runtime
|
210
295
|
prerelease: false
|
211
|
-
version_requirements:
|
296
|
+
version_requirements: !ruby/object:Gem::Requirement
|
297
|
+
none: false
|
298
|
+
requirements:
|
299
|
+
- - '='
|
300
|
+
- !ruby/object:Gem::Version
|
301
|
+
version: 0.7.2
|
212
302
|
description: Required dependency for Spree
|
213
303
|
email: sean@spreecommerce.com
|
214
304
|
executables: []
|
@@ -415,6 +505,7 @@ files:
|
|
415
505
|
- app/models/spree/option_value.rb
|
416
506
|
- app/models/spree/order/checkout.rb
|
417
507
|
- app/models/spree/order.rb
|
508
|
+
- app/models/spree/order_populator.rb
|
418
509
|
- app/models/spree/order_updater.rb
|
419
510
|
- app/models/spree/payment/processing.rb
|
420
511
|
- app/models/spree/payment.rb
|
@@ -1155,11 +1246,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1155
1246
|
version: '0'
|
1156
1247
|
segments:
|
1157
1248
|
- 0
|
1158
|
-
hash:
|
1249
|
+
hash: -4519868674944601549
|
1159
1250
|
requirements:
|
1160
1251
|
- none
|
1161
1252
|
rubyforge_project: spree_core
|
1162
|
-
rubygems_version: 1.8.
|
1253
|
+
rubygems_version: 1.8.23
|
1163
1254
|
signing_key:
|
1164
1255
|
specification_version: 3
|
1165
1256
|
summary: Core e-commerce functionality for the Spree project.
|