hi,
For Rails Commerce
http://rails-commerce.com we want to make a rule
generator like Magento.
We want to build rule's conditions with a html form and pass some
variables in the rule to special offers or shipping methods selection.
For this we need to store rule's condition in database as string, we
think that the tiger DSL is appropriate.
Store Ferrari syntax in database is synonym of eval store strings in
rule execution like :
rule = Rule.first
puts rule.condition
=>"[Product, :p, { :discount => 10 }, m.weight >= 15,
m.name ==
'IPhone' ]"
rule rule.id.to_sym, eval(rule.condition) do |v|
v[:p].price -= v[:discount]
end
Do you think the tiger DSL still deprecated in future versions of
Ruleby ?
Because it's more safe to store tiger syntax in database and don't
eval it like :
puts rule.condition
=> "Product as :p where #weight >= 15 #&& #name == 'IPhone'"
If it is the case how do you think we can store rule's condition in a
database ?
Thanks.