不同版本的name可以重复



- validates :name, presence: true, uniqueness: { conditions: -> { where(:state.ne => 2) } }, length: { maximum: 9 }
+ validates :name, presence: true, length: { maximum: 9 }

validates :name, presence: true, uniqueness: { conditions: -> { where(:state.ne => 2) }, scope: :version}, length: { maximum: 9 }


你可能感兴趣的:(不同版本的name可以重复)