我想在我的自定义验证方法中调用活动记录验证方法
class Asset < ActiveRecord::Base validate :ensure_unique_identification_code validates :name,:uniqueness=>true def ensure_unique_identification_code self.identifier="identifier code" #code is generated using some helper method of Asset model validates :identifier,:uniqueness=>true end end
给出错误
undefined method `validates' for #<Asset:0xb6692dbc>