i want to call active record validation method in my custom validation method like
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
give error
undefined method `validates' for #<Asset:0xb6692dbc>
how can we call validation methods in instance methods of a model