You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my database, the "orders" table has no record with aasm_state of "paid".
I thought it should just return an empty table, with size 0.
But I'm getting
Ruport::FormatterError: Can't output table without data or column names.
How do I avoid this error?
In practice, it's possible that a table is empty. It would be ugly if I have to check
for this condition before calling Order.report_table(...)
Thanks.
The text was updated successfully, but these errors were encountered:
Hello.
I have the following code:
table = Order.report_table(:all, :conditions => "aasm_state = 'paid'")
In my database, the "orders" table has no record with aasm_state of "paid".
I thought it should just return an empty table, with size 0.
But I'm getting
Ruport::FormatterError: Can't output table without data or column names.
How do I avoid this error?
In practice, it's possible that a table is empty. It would be ugly if I have to check
for this condition before calling Order.report_table(...)
Thanks.
The text was updated successfully, but these errors were encountered: