Skip to content

Commit

Permalink
Merge pull request solidusio#2843 from nebulab/nebulab/2.6.1
Browse files Browse the repository at this point in the history
Fix Solidus v2.6 and prepare a 2.6.1 release
  • Loading branch information
kennyadsl committed Sep 13, 2018
2 parents 1b27e30 + e2f21f4 commit 3f5e367
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
6 changes: 1 addition & 5 deletions core/app/models/spree/distributed_amounts_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ def subtotal
elligible_amounts.sum
end

def weights
elligible_amounts.map { |amount| amount.to_f / subtotal.to_f }
end

def allocated_amounts
total_amount.to_money.allocate(weights).map(&:to_money)
total_amount.to_money.allocate(elligible_amounts).map(&:to_money)
end
end
end
2 changes: 1 addition & 1 deletion core/lib/spree/core/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Spree
def self.solidus_version
"2.6.0"
"2.6.1"
end

def self.solidus_gem_version
Expand Down
4 changes: 2 additions & 2 deletions core/solidus_core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Gem::Specification.new do |s|
s.add_dependency 'discard', '~> 1.0'
s.add_dependency 'friendly_id', '~> 5.0'
s.add_dependency 'kaminari-activerecord', '~> 1.1'
s.add_dependency 'monetize', '~> 1.1'
s.add_dependency 'monetize', '~> 1.8'
s.add_dependency 'paperclip', ['>= 4.2', '< 6']
s.add_dependency 'paranoia', '~> 2.4'
s.add_dependency 'ransack', '~> 1.8'
s.add_dependency 'ransack', '~> 2.0'
s.add_dependency 'state_machines-activerecord', '~> 0.4'
end
9 changes: 5 additions & 4 deletions core/spec/models/spree/order_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,13 @@ def merge!(other_order, user = nil)

it "does nothing if any shipments are ready" do
shipment = create(:shipment, order: subject, state: "ready")
expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments }
expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments.pluck(:id) }
expect { shipment.reload }.not_to raise_error
end

it "does nothing if any shipments are shipped" do
shipment = create(:shipment, order: subject, state: "shipped")
expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments }
expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments.pluck(:id) }
expect { shipment.reload }.not_to raise_error
end
end
Expand Down Expand Up @@ -1102,11 +1102,12 @@ def generate

it "raises an error if any shipments are ready" do
shipment = create(:shipment, order: subject, state: "ready")

expect {
expect {
subject.create_proposed_shipments
}.to raise_error(Spree::Order::CannotRebuildShipments)
}.not_to change { subject.reload.shipments }
}.not_to change { subject.reload.shipments.pluck(:id) }

expect { shipment.reload }.not_to raise_error
end
Expand All @@ -1117,7 +1118,7 @@ def generate
expect {
subject.create_proposed_shipments
}.to raise_error(Spree::Order::CannotRebuildShipments)
}.not_to change { subject.reload.shipments }
}.not_to change { subject.reload.shipments.pluck(:id) }

expect { shipment.reload }.not_to raise_error
end
Expand Down

0 comments on commit 3f5e367

Please sign in to comment.