module Spree
Address.class_eval do
has_one :creditcard
def validate
errors = self.errors.map {|attr, message| [attr, message]}
self.errors.clear
errors.each do |attr, message|
self.errors.add(attr, message) unless attr == "phone"
end
end
end
end
This is the response I am getting back from spree:
{\"error\":\"The order could not be transitioned. Please fix the errors and try again.\",\"errors\":{\"bill_address.phone\":[\"can't be blank\"],\"ship_address.phone\":[\"can't be blank\"]}}", @response=#<Net::HTTPClientError 422 readbody=true>, @headers={"content-type"=>["text/html"], "x-ua-compatible"=>["IE=Edge"], "cache-control"=>["no-cache"], "x-request-id"=>["96ad34f13152b1d4b1ede587818c745f"], "x-runtime"=>["0.694875"], "content-length"=>["176"], "server"=>["WEBrick/1.3.1 (Ruby/1.9.2/2011-07-09)"], "date"=>["Thu, 16 Aug 2012 23:10:10 GMT"], "connection"=>["close"]}
--
You received this message because you are subscribed to the Google Groups "Spree" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spree-user/-/_57qh3nArFsJ.
To post to this group, send email to spree...@googlegroups.com.
To unsubscribe from this group, send email to spree-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/spree-user/-/JApSBWcDNFwJ.