Used Active Record function.