This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am prorok64b on github. | |
* I am vfilipov (https://keybase.io/vfilipov) on keybase. | |
* I have a public key ASDaIfAwrMRDo-bNqdyTAGu7hHmUGxQLkl4auJMnTRiYhwo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ApplicationRecord | |
self.ignored_columns = %w[disabled updated_at] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User.select('name', 'created_at') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User.joins(:posts).select('users.id AS user_id', 'posts.id AS post_id') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User.includes(:posts) | |
# produces: | |
# SELECT * FROM users; | |
# SELECT * FROM posts WHERE posts.user_id IN (...users ids) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User.includes(:posts) | |
# produces: | |
# SELECT * FROM users | |
# SELECT * FROM posts WHERE posts.user_id IN (...users ids) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User.includes(:posts) | |
# nested associations | |
User.includes(posts: [:comments, :likes]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
has_many( | |
:posts, | |
-> { where(public: true, disabled: 0) } | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"version":1,"resource":"file:///Users/vadymfilipov/Dev/callmeapp/app/services/hades_queue/orders/creator/attributes_builder.rb","entries":[{"id":"IEgP.rb","timestamp":1653902002101},{"id":"0CZd.rb","timestamp":1653902096920},{"id":"Vpu6.rb","timestamp":1653902488368},{"id":"iABG.rb","timestamp":1653902698996},{"id":"l7UZ.rb","timestamp":1653903275674},{"id":"t8tv.rb","timestamp":1653903301145},{"id":"RIuF.rb","timestamp":1653903371658},{"id":"tkay.rb","timestamp":1653903424692},{"id":"q1Dj.rb","timestamp":1653903464859},{"id":"odzR.rb","timestamp":1653903484874},{"id":"3asT.rb","timestamp":1653903529216},{"id":"5aUc.rb","timestamp":1653903551317},{"id":"dc5S.rb","timestamp":1653903561653},{"id":"RMXW.rb","timestamp":1653903610806},{"id":"BK1p.rb","timestamp":1653903625662},{"id":"ghuM.rb","timestamp":1653903645175},{"id":"KaQF.rb","timestamp":1653903665475},{"id":"pYst.rb","timestamp":1653906684222},{"id":"IINt.rb","timestamp":1653906779133},{"id":"1l5u.rb","timestamp":1657263397748},{"id":"ucO9.rb","timesta |