Smarter ActiveRecord models