Implement ActiveRecord state handling. AR if now functional.