complete ActiveRecord coding