jespr/rconomic — comment on commit f3f4fa7fbf88804239d5d264bb60bdc9864d68ef
File: lib/economic/proxies/cash_book_proxy.rb line 26
By koppen:

The E-conomic API doesn't support returning any useful data in *_GetAll operations so I'm afraid we're stuck with working around it somehow.

Depending on your use case, your application should be able to do

cash_books = economic.cash_books.all
cash_books.each do |cash_book|
puts cash_book.name if cash_book.number > 1000
end

and have Rconomic transparently handling getting the data from the API when necessary. I don't think it's up to Rconomic to fetch the name for each CashBook.

In any case, it makes little sense to only fetch the name. We should probably fetch all the data (ie `Economic::Entity#get_data`) if anything - not that there is anything other than a name right now in CashBook, but there might be in the future, and there definitely are in other entities.

If we do support this in the Rconomic API, it should probably be a toggleable option so you don't inadvertently send unnecessary requests.