Answer the question
In order to leave comments, you need to log in
How to add a Lua interpreter to Sublime Text 3?
I decided to write in Lua in Sublime Text 3, but wondered how to "insert" the above Lua interpreter into this text editor. More specifically, in this field:
Answer the question
In order to leave comments, you need to log in
If you describe the problem like that, everyone will break their heads here too.
At least throw off the links of all these models.
What is the problem specifically? You can display all queries, think? DownloadRequest.all
Can you also see the number of installs per user? (It's not clear how it works for you)
If without SQL, just map, select (actions on an array) - can you solve the problem this way? And a problem only in drawing up of optimum request?
and the description of the tables is not attached? And between them it would be very good to see.
and then according to your request: I have 4 (apps, users, download_requests, installs) tables, help me make a selection of them as I want, but I won’t show you the structure.
Your user
models are not correctly linked
has_many :orders #это лучше чем download_requests
has_many :apps, through: :order #получаем app через order
belongs_to :user #связываем юзера с заявкой
belongs_to :app #связываем приложение с заявкой
has_many :orders
has_many :users, through: :order #получаем юзеров через order
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question