Advanced ActiveRecord dynamic methods