Dispelling more Rails magic through rebuilding ActiveRecord functionality