O
O
oia2017-04-02 21:24:53
Ruby on Rails
oia, 2017-04-02 21:24:53

Need help identifying a fastener?

and so the fasteners were broken, I want to order a new one, but I don’t know what it’s called here is a photo 9ea1e5e3ccf34eba830b7210ac4b7e17.PNG and 631d6378d5fa4c1da0130102e1b29378.PNG
if there is, give links to Ali

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
blackst0ne, 2018-03-01
@Ilnar25

# AR
Order.where(store_id: var).group(:created_at).sum(:total_price)

# Scope 
scope :sum_orders, -> (var) { where(store_id: var).group(:created_at).sum(:total_price) }

D
Dmitri Sinitsa, 2018-02-28
@unabl4

In my opinion, it is easier to rewrite it on rails.
In the scope method, I think you can arrange this whole thing yourself, so that it is beautiful, like raw sql in rails is needed when everything is very, very bad. So bad that the query cannot be written, for example, in the same arel table. It must be a very specific animal. Everything else is easy to sign through ActiveRecord without much effort.

T
TyzhSysAdmin, 2017-04-02
@POS_troi

Go to the auto shop, to the department where they sell card clips.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question