lib/braintree_rails/customer.rb in braintree-rails-0.4.0 vs lib/braintree_rails/customer.rb in braintree-rails-0.4.1
- old
+ new
@@ -5,11 +5,11 @@
validates :id, :format => {:with => /^[-_a-z0-9]*$/i}, :length => {:maximum => 36}, :exclusion => {:in => %w(all new)}
validates :first_name, :last_name, :company, :website, :phone, :fax, :length => {:maximum => 255}
attr_reader :addresses, :credit_cards
-
+
def initialize(customer = {})
customer = ensure_model(customer)
@addresses = Addresses.new(self, customer.try(:addresses))
@credit_cards = CreditCards.new(self, customer.try(:credit_cards))
super(customer)
@@ -21,6 +21,6 @@
def transactions
new_record? ? [] : @transactions ||= Transactions.new(self)
end
end
-end
\ No newline at end of file
+end