select * from payment_transactions outer left join utility_providers ..... where .....
Too long... what about activerecord objects using script/console?
PaymentTransaction.find(:all, :conditions => [........])
Better but the conditions string can get unweldy. But why not use namedscopes?
PaymentTransaction.vendor('Singtel').amount('30.00').account('123456').date_less_than('2009-08-01')
Short and sweet! Plus if you use the Searchlogic gem, these namedscopes comes for free! :)
No comments:
Post a Comment