Recreation of essential ActiveRecord methods