Hi Everyone,
I added this query and added attr_accessor "balance_amount" and
"booking_customer_id" in customers table, my query sets the value on
attribute accessor but I am not able to fetch it from the dataset result,
the query is:
SELECT * from customers
> LEFT JOIN
> (
> SELECT cr.booking_customer_id, current_balance -
> coalesce(booking_amount, 0) as balance_amount
> FROM (Distinct record from table 2, i.e. bookings) cr
> RIGHT JOIN (Distinct record from table 3, e.g. balance) cb
> ON (booking_customer_id = balance_customer_id)
> ) cwr
> ON (customers.id = cwr.bookings_customer_id)
when I do, dataset.all and It shows `balance_amount` in the results, try
to fetch like: `dataset.all.first.balance_amount` it returns nil. What am I
doing wrong here?
Thanks :)
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/3ce501bc-7974-43b1-a95d-f558784f4856%40googlegroups.com.