Skip to content
Browse files

fixed: customer update fail.

  • Loading branch information...
1 parent e8f1b5d commit 98b8565b12a29d0b3adffc0fc4e6fde7ae58ae28 @saberma saberma committed Aug 31, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 app/models/customer.rb
View
3 app/models/customer.rb
@@ -15,8 +15,9 @@ class Customer < ActiveRecord::Base
attr_accessible :id, :name, :email, :orders_count, :note, :accepts_marketing, :tags_text, :addresses_attributes, :password, :password_confirmation
before_create :ensure_authentication_token # 生成login token,只使用一次
- validates_presence_of :name, :email, :password
+ validates_presence_of :name, :email
validates :email, uniqueness: {scope: :shop_id}, format: {with: Devise::Email::EXACT_PATTERN }
+ validates_presence_of :password, if: :password_required?
validates :password, confirmation: true, length: 6..20, if: :password_required?
validates :name, length: 2..10

0 comments on commit 98b8565

Please sign in to comment.
Something went wrong with that request. Please try again.