Client Load (0.000000) SELECT clients.client_status as
breakdown_id,count(clients.client_status)as record_count FROM clients
left join programmes on clients.programme_id = programmes.id WHERE
(clients.programme_id = 12 ) GROUP BY clients.client_status ORDER BY
record_count desc
This is fine…
But when I try to access the “breakdown_id” column from the query
(clients.client_status as breakdown_id) it fails with:
NoMethodError (undefined method `breakdown_id’ for #<Client:
0xfd9b4d>):
eg.
for breakdown in @breakdowns
logger.info("breakdown_id= #{breakdown.breakdown_id})
end
This has been working fine until I tried to deploy with JRuby.
Client Load (0.000000) SELECT clients.client_status as
breakdown_id,count(clients.client_status)as record_count FROM clients
left join programmes on clients.programme_id = programmes.id WHERE
(clients.programme_id = 12 ) GROUP BY clients.client_status ORDER BY
record_count desc
This is fine…
But when I try to access the “breakdown_id” column from the query
(clients.client_status as breakdown_id) it fails with:
NoMethodError (undefined method `breakdown_id’ for #<Client:
0xfd9b4d>):
eg.
for breakdown in @breakdowns
logger.info("breakdown_id= #{breakdown.breakdown_id})
end
This has been working fine until I tried to deploy with JRuby.
Any ideas… surely I can alias column names?
Cheers
Giorgio.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.