Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delegations #559

Closed
wants to merge 8 commits into from
Prev Previous commit
Next Next commit
Delegate #code to shipment_method
  • Loading branch information
tanmay3011 committed Dec 2, 2015
commit 21224ef8f13dfe2b92a0b6f2baaaf4ee2561c74d
5 changes: 1 addition & 4 deletions core/app/models/spree/shipping_rate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class ShippingRate < Spree::Base

delegate :order, :currency, to: :shipment
delegate :name, to: :shipping_method
delegate :code, to: :shipping_method, prefix: true

def display_base_price
Spree::Money.new(cost, currency: currency)
Expand Down Expand Up @@ -46,10 +47,6 @@ def shipping_method
Spree::ShippingMethod.unscoped { super }
end

def shipping_method_code
shipping_method.code
end

def tax_rate
Spree::TaxRate.unscoped { super }
end
Expand Down