add the function of ActiveRecord