Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move clone_billing_address to be with other before_validation call in…

… Order model

This was previously ~250 lines down in the model
  • Loading branch information...
commit 40b1f9e2fe3aee776c8b7c3369fe1018addf4bf5 1 parent 6184c3c
@radar radar authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 core/app/models/spree/order.rb
View
5 core/app/models/spree/order.rb
@@ -40,6 +40,8 @@ class Order < ActiveRecord::Base
# Needs to happen before save_permalink is called
before_validation :generate_order_number, :on => :create
+ before_validation :clone_billing_address, :if => :use_billing?
+ attr_accessor :use_billing
before_create :link_by_email
after_create :create_tax_charge!
@@ -237,9 +239,6 @@ def restore_state
end
end
- before_validation :clone_billing_address, :if => :use_billing?
- attr_accessor :use_billing
-
def clone_billing_address
if bill_address and self.ship_address.nil?
self.ship_address = bill_address.clone
Please sign in to comment.
Something went wrong with that request. Please try again.