A dynamic rule engine based on ActiveRecord