I want to call the verification method of the active record in my usual verification method, for example
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 an error
undefined method `validates' for #<Asset:0xb6692dbc>
how can we call validation methods in model instance methods
source share