Closed james075 closed 10 years ago
Since it's related to the mail validation a possible fix could be to temporarly disable the uniqueness
validator.
class Spree::Supplier < Spree::Base
.....
validates :email, presence: true, email: true, uniqueness: true
to
class Spree::Supplier < Spree::Base
.....
validates :email, presence: true, email: true
For an unknown reason, It seems that when checking records for an already existing supplier
, user
records are also considered.
That's really odd I expected the error message to be the {email: true} option, and would have thought uniqueness would be a different message like it's already been taken.
This might be related, but it's frontend not backend create: https://github.com/JDutil/spree_marketplace/blob/master/app/controllers/spree/suppliers_controller.rb#L14-L23
Is this issue related with this: https://github.com/spree/spree/issues/5368 ?
I was thinking that may be the case, but I've since fixed that issue. I would make sure you're running the latest commits of spree 2-3-stable and see if that helps resolve the problem. I haven't reproduced this error yet it.
Actually, it was because of the use of a wrong version of spree. The issue is not present anymore using spree 2-3-stable. Maybe compatibility related. Thanks.
On become a supplier I got this error:
Same when I want to create one from the admin back-end:
Note: I performed the install in this order and migrated on each step without any error:
Here you can find schema.rb file
Gemfile:
Console logs: