I'm having trouble figuring out which approach is better.
I have the following tables: products, orders and line_items.
Every time an Order is placed, the quantity field in the products
table has to be updated for each LineItem in the Order. One option is
to use DB triggers which is not as portable as using before_create in
the Order model. But with before_create I cannot use fixtures for
orders and line_items since they don't use before_create as models do.
Has anyone any recommendations on which approach is better?
Not quite... fixtures are "fixed" pieces of data that you test your
models and controllers against. You need to make sure they always fit
your business rules even as they change.
Fixtures are not meant for testing your validation methods. You
should use unit tests for that.