added ActiveRecord implementation