« Back to channel list

#RubyOnRails - 07 September 2018

« Back 1 day Forward 1 day »
[00:04:48] baweaver: There are, most of us are on both channels but don't tend to say much unless we see a question around.
[00:05:39] baweaver: headed off for now, be back later.
[00:30:19] setient: has joined #RubyOnRails
[00:46:42] orbyt_: has joined #RubyOnRails
[00:57:50] Technodrome: has joined #RubyOnRails
[00:58:31] wojnar: has joined #RubyOnRails
[00:58:31] brandoncc: has joined #RubyOnRails
[01:02:59] Linuus: has joined #RubyOnRails
[01:04:10] sevenseacat: has joined #RubyOnRails
[01:10:20] cagomez: has joined #RubyOnRails
[01:11:50] bga57: has joined #RubyOnRails
[01:42:21] egray: has joined #RubyOnRails
[01:44:09] ariedler: has joined #RubyOnRails
[01:44:29] fourcolors: has joined #RubyOnRails
[01:49:09] matcouto: has joined #RubyOnRails
[01:51:20] fourcolors: has joined #RubyOnRails
[02:05:10] choke: has joined #RubyOnRails
[02:09:45] tdy: has joined #RubyOnRails
[02:16:50] Saukk: has joined #RubyOnRails
[02:21:27] orbyt_: has joined #RubyOnRails
[02:26:43] kotepillar_: has joined #RubyOnRails
[02:40:38] EXCHGR: has joined #RubyOnRails
[02:40:41] Linuus: has joined #RubyOnRails
[02:48:24] ShekharReddy: has joined #RubyOnRails
[02:52:33] duderonomy: has joined #RubyOnRails
[02:52:49] choke: has joined #RubyOnRails
[02:56:34] DTZUZO: has joined #RubyOnRails
[03:09:17] braincrash: has joined #RubyOnRails
[03:22:00] kotepillar__: has joined #RubyOnRails
[03:24:44] brandoncc: has joined #RubyOnRails
[03:28:56] Technodrome: has joined #RubyOnRails
[03:32:06] kotepillar_: has joined #RubyOnRails
[03:55:22] sonOfRa: has joined #RubyOnRails
[04:06:45] Guest58115: has joined #RubyOnRails
[04:09:27] duderonomy: has joined #RubyOnRails
[04:27:31] fourcolors: has joined #RubyOnRails
[04:30:57] planigan: has joined #RubyOnRails
[04:37:14] srinidhi: has joined #RubyOnRails
[04:38:39] fourcolors: has joined #RubyOnRails
[04:44:59] v01d4lph4: has joined #RubyOnRails
[04:53:50] srinidhi: has joined #RubyOnRails
[04:54:00] SteenJobs: has joined #RubyOnRails
[04:56:07] orpl: has joined #RubyOnRails
[04:59:13] orbyt_: has joined #RubyOnRails
[05:08:56] cosmicfires: has left #RubyOnRails: ("Leaving")
[05:14:56] reber: has joined #RubyOnRails
[05:19:44] Technodrome: has joined #RubyOnRails
[05:29:14] kotepillar_: has joined #RubyOnRails
[05:34:26] duderonomy: has joined #RubyOnRails
[05:43:25] nemesit: has joined #RubyOnRails
[05:44:16] andrew91841: has joined #RubyOnRails
[05:55:36] duderonomy: has joined #RubyOnRails
[06:02:25] v01d4lph4: has joined #RubyOnRails
[06:14:14] duderonomy: has joined #RubyOnRails
[06:26:15] duderonomy: has joined #RubyOnRails
[06:34:27] joelroa: has joined #RubyOnRails
[06:35:09] duderonomy: has joined #RubyOnRails
[06:37:03] dionysus69: has joined #RubyOnRails
[06:41:43] arathald: has joined #RubyOnRails
[06:42:44] duderonomy: has joined #RubyOnRails
[06:42:47] fourcolors: has joined #RubyOnRails
[06:52:08] duderonomy: has joined #RubyOnRails
[06:59:35] kapil___: has joined #RubyOnRails
[07:01:31] Linuus: has joined #RubyOnRails
[07:15:29] uks: has joined #RubyOnRails
[07:17:01] kotepillar_: is there any gem let localhost:3000/users/user_id/?fields=[‘name’, ‘age’] // just response what I wanted fields
[07:26:06] Guest58115: has joined #RubyOnRails
[07:31:46] lomex: has joined #RubyOnRails
[07:46:58] Linuus: has joined #RubyOnRails
[07:52:04] Linuus: has joined #RubyOnRails
[07:52:06] mikecmpbll: has joined #RubyOnRails
[08:11:53] lomex: has joined #RubyOnRails
[08:23:15] kotepillar_: I want to control what I response(json format) from my url query parameters, forexample localhost:3000?fields=name,age
[08:27:57] Linuus: has joined #RubyOnRails
[08:57:14] DTZUZO: has joined #RubyOnRails
[09:01:24] madsj: has joined #RubyOnRails
[09:40:28] srinidhi: has joined #RubyOnRails
[09:47:02] egray: has joined #RubyOnRails
[09:49:23] unCork: has joined #RubyOnRails
[09:55:27] Technodrome: has joined #RubyOnRails
[09:57:31] kotepillar_: has joined #RubyOnRails
[10:40:28] Ergo: has joined #RubyOnRails
[10:52:08] lankanmon: has joined #RubyOnRails
[10:55:42] ariedler: has joined #RubyOnRails
[10:56:11] dionysus70: has joined #RubyOnRails
[11:24:03] pama: has joined #RubyOnRails
[11:24:20] apeiros_: has joined #RubyOnRails
[11:24:31] pama: Hello, is there a way to activate the CACHE load (Active Record) on logs? It seems that in Rails 5.2 we no longer have that.
[11:31:19] tbuehlmann: pama: works for me. how do you test it?
[11:33:06] pama: @tbuehlmann I look at the logs in development and I no longer see them. I see the Load (with the sql query), bot not the CACHE hits.
[11:34:27] tbuehlmann: maybe it's not caching? :)
[11:35:02] tbuehlmann: can you try this in a rails console? `ActiveRecord::Base.cache { SomeModel.first; SomeModel.first }`
[11:36:46] pama: tbuehlmann: it needs to, because I'm accessing through a belongs_to in a loop, and the object with a same id was loaded before in a before action. Also, it's consistent in all pages.
[11:37:26] tbuehlmann: can you gist the code for this?
[11:37:32] tbuehlmann: and check the rails console thing?
[11:37:48] pama: tbuehlmann: In the console works.
[11:38:37] tbuehlmann: so chances are AR is not caching. can you gist your code?
[11:38:41] pama: tbuehlmann: let me try to add that to my code and see if it logs.
[11:48:25] magellanicloud: has joined #RubyOnRails
[11:51:19] kotepillar_: who know how to realize localhost:3000/user/<user_id>?fields=name,age -> only select name and age from user instance
[11:54:37] Terens: has joined #RubyOnRails
[11:54:47] Terens: hello I work on a project where everything is implemented
[11:54:51] Terens: in models
[11:55:00] Terens: it is not big it has about 100models
[11:55:13] Terens: but everything is within callbacks
[11:55:22] Terens: and concerns
[11:55:42] Terens: is this ok long term?
[11:56:07] sevenseacat: is it ok now?
[11:56:44] Terens: yes adding new features not big problem yet
[11:56:53] sevenseacat: thats surprising
[11:57:00] Terens: even sending sms is done through concern
[11:57:06] sevenseacat: how slow is your test suite? :D
[11:57:18] Terens: there is no test suite
[11:57:27] sevenseacat: thats a much bigger problem.
[11:57:28] Terens: I joined this project three months ago
[11:57:52] Terens: but since they work in a specific way I can't do something different
[11:57:55] sevenseacat: how do you know you aren't breaking anything whenever you add a new feature?
[11:58:03] Terens: boss says I want new features - no tests etc
[11:58:14] Terens: and works fine with few bugs
[11:58:21] sevenseacat: that you know of
[11:58:29] Terens: yes sometimes they break but we do manual testing
[11:58:37] sevenseacat: of every feature, every time you make a change?
[11:58:42] Terens: initially at first month I used to break things
[11:59:00] sevenseacat: get some tests in there. they'll pay for themselves in no time.
[11:59:10] Terens: I know but I am not allowed
[11:59:32] Terens: and it is not testable because there are things in thread.current and lots of other stuff
[12:00:03] Terens: I though that this would lead to disaster but it seems that project is growing ok
[12:00:42] sevenseacat: I'd argue that you have no idea if its okay because with no tests you have no idea what it does or doesnt do
[12:01:14] Terens: yes sure some things dont work but we dont know it
[12:08:01] pama: tbuehlmann: It seems that works, thanks to point me the evidence. I was expecting to see the n+1 issue. But it seems that I don't have it in this particular situation. Let me create a gist for you to illustrate.
[12:12:01] mostlybadfly: has joined #RubyOnRails
[12:16:23] jonno112: has joined #RubyOnRails
[12:16:26] mello: has joined #RubyOnRails
[12:19:12] mello: hey, ive been looking for a way to put my rails web api in production as a docker image, and just curios if anyone has found a nice article or tutorial on how to best do that. I found alot of tutorials that explains the process for a whole RoR app regarding the views and all and im not on what i only would need to use for a web api app.
[12:19:26] wojnar: has joined #RubyOnRails
[12:21:52] Linuus: has joined #RubyOnRails
[12:49:30] argoneus: has joined #RubyOnRails
[12:49:39] pama: tbuehlmann: I hope you still around, this is what was confusing me: https://gist.github.com/pama/092ada82486385367c3f04376e02d8ea
[12:51:30] hays_: has joined #RubyOnRails
[13:15:22] kotepillar_: has joined #RubyOnRails
[13:18:00] tbuehlmann: pama: the active record cache works per request, so it caches certain queries for a single request
[13:21:34] pama: tbuehlmann: I understand that, but if you look to example 2, there are two questions to Company, one related to the first line of the controller, and the other inside the loop on the view, whereas in the example 1, you just have one. What I don't understand is why in the first example, the first time (inside the loop) we hit company, nothing is stated in the log, like loading from cache or a normal Load.
[13:26:29] pama: tbuehlmann: as I see it, in the second example, when rails tries to access to a company asks something like: did I do that before? I did it, lets load it from cache. And logs it. I was expecting to see the same behaviour in the first example.
[13:27:21] tbuehlmann: for which query exactly do you expect it?
[13:28:55] tbuehlmann: you also wouldn't do it that way, you'd include the company when fetching all orders, right?
[13:29:08] pama: tbuehlmann: when looping in the view. I have the company because Its on the first line of the controller action. But I access to it in the view look through the offer. So, when I do offer.company I was expecting a cache hit log.
[13:29:26] pama: look -> loop
[13:30:27] pama: tbuehlmann: actually I was expecting a full Load to be consistent with what I see on the second example logs!
[13:31:12] pama: let me create a picture for you, maybe it will be easier to show my point.
[13:32:31] tbuehlmann: _now_ I see what you mean
[13:34:32] kfatehi: has joined #RubyOnRails
[13:35:38] tbuehlmann: I can reproduce it and don't know why that is :)
[13:42:07] pama: tbuehlmann: I wonder what is going on in the background. Everything started with a review. I saw someone building a url in the first example, using the company id through offer.company.id instead going through the @company, and I said that would be more efficient using @company since offer.company will always be @company (due to the filter), but the developer said that couldn't tell the difference from logs.
[14:01:08] dionysus70: has joined #RubyOnRails
[14:01:36] tbuehlmann: it just seems like the cache is disabled on the very first request after starting the server for whatever reason
[14:01:41] tbuehlmann: get to go now, happy coding
[14:03:02] apeiros_: is there a suggested base image for docker to build rails apps from?
[14:17:31] v01d4lph4: has joined #RubyOnRails
[14:17:52] brandoncc: has joined #RubyOnRails
[14:32:06] v01d4lph4: has joined #RubyOnRails
[14:33:32] Technodrome: has joined #RubyOnRails
[14:42:10] NL3limin4t0r: has joined #RubyOnRails
[14:47:22] apeiros: hm, got to go. maybe I'll get an answer next time :)
[14:55:04] Technodrome: has joined #RubyOnRails
[14:59:52] Dbugger: has joined #RubyOnRails
[15:16:48] hervie: has joined #RubyOnRails
[15:25:28] kapil___: has joined #RubyOnRails
[15:30:56] NL3limin4t0r: So I just ran into some anoying RoR logic. I have some incomming data from an external SOAP request and I'd like to use the included id as my own. This works fine for a single record (`Model.create(id: 123)`) but doesn't work when the attribute is nested using the `accept_nested_attributes_for` option. If I provide an id for one of the nested resources it raises an error that it can't be found.
[15:30:59] NL3limin4t0r: https://gist.github.com/3limin4t0r/8383e117700b1c60052737d12ba780d2
[15:31:39] NL3limin4t0r: Is there an easy way to create the nested resources with specified id?
[15:38:59] NL3limin4t0r: I guess I could manually build them, but that seems a bit cumbersome.
[15:42:41] NL3limin4t0r: eg. `Article.create(data.except(:times_attributes)) { |article| data[:times_attributes]&.each { |time_params| article.times.build(time_params) } }`
[15:51:46] duderonomy: has joined #RubyOnRails
[15:56:48] orbyt_: has joined #RubyOnRails
[15:59:33] cagomez: has joined #RubyOnRails
[16:00:32] Linuus: has joined #RubyOnRails
[16:09:04] fourcolors: has joined #RubyOnRails
[16:18:49] Technodrome: has joined #RubyOnRails
[16:26:43] fourcolors: has joined #RubyOnRails
[16:35:28] Technodrome: has joined #RubyOnRails
[16:36:00] SteenJobs: has joined #RubyOnRails
[16:37:11] brandoncc: has joined #RubyOnRails
[16:41:38] fourcolors: has joined #RubyOnRails
[16:43:42] dionysus69: has joined #RubyOnRails
[16:51:41] anubhav996: has joined #RubyOnRails
[17:08:43] desperek: has joined #RubyOnRails
[17:20:11] ShekharReddy: has joined #RubyOnRails
[17:23:00] jackhum: has joined #RubyOnRails
[17:29:47] Technodrome: has joined #RubyOnRails
[17:30:55] NL3limin4t0r: I've got to go. I've created an Stack Overflow question (https://stackoverflow.com/q/52226760/3982562) for any late answers that might be coming in.
[17:37:08] ellcs: has joined #RubyOnRails
[17:39:39] eckhardt: has joined #RubyOnRails
[17:41:16] duderonomy: has joined #RubyOnRails
[17:45:19] segy: has joined #RubyOnRails
[17:48:29] woohoou: has joined #RubyOnRails
[18:08:31] prettybTech: has joined #RubyOnRails
[18:32:36] fourcolors: has joined #RubyOnRails
[18:36:41] Ergo: has joined #RubyOnRails
[18:48:08] Guest58115: has joined #RubyOnRails
[18:51:37] jottr: has joined #RubyOnRails
[18:58:34] Guest58115: has joined #RubyOnRails
[19:04:06] Linuus: has joined #RubyOnRails
[19:08:17] Guest58115: has joined #RubyOnRails
[19:20:31] jottr: has joined #RubyOnRails
[19:25:07] mikecmpbll: has joined #RubyOnRails
[19:27:41] Ergo: has joined #RubyOnRails
[19:36:25] jackhum: has joined #RubyOnRails
[19:51:23] dionysus69: has joined #RubyOnRails
[19:57:46] Linuus: has joined #RubyOnRails
[19:59:20] jottr: has joined #RubyOnRails
[20:15:29] jottr: has joined #RubyOnRails
[20:33:41] lomex: has joined #RubyOnRails
[20:35:42] tdy: has joined #RubyOnRails
[20:40:03] Linuus: has joined #RubyOnRails
[20:53:58] jackhum: has joined #RubyOnRails
[20:59:16] knight33: has joined #RubyOnRails
[21:16:07] Guest58115: has joined #RubyOnRails
[21:17:58] Technodrome: has joined #RubyOnRails
[21:20:53] ivanskie: has joined #RubyOnRails
[21:33:23] Guest58115: has joined #RubyOnRails
[21:41:44] beowuff: has joined #RubyOnRails
[21:43:20] Guest58115: has joined #RubyOnRails
[21:53:19] Guest58115: has joined #RubyOnRails
[22:03:25] Guest58115: has joined #RubyOnRails
[22:10:29] agent_white: has joined #RubyOnRails
[22:10:58] fourcolors: has left #RubyOnRails: ()
[22:11:00] fourcolors: has joined #RubyOnRails
[22:13:19] Guest58115: has joined #RubyOnRails
[22:20:40] beowuff: has joined #RubyOnRails
[22:23:22] Guest58115: has joined #RubyOnRails
[22:33:21] Guest58115: has joined #RubyOnRails
[22:43:16] Guest58115: has joined #RubyOnRails
[22:49:16] Linuus: has joined #RubyOnRails
[22:53:15] Guest58115: has joined #RubyOnRails
[22:54:17] Linuus: has joined #RubyOnRails
[22:56:02] prettybT_: has joined #RubyOnRails
[23:02:59] brandoncc: has joined #RubyOnRails
[23:03:17] Guest58115: has joined #RubyOnRails
[23:13:23] Guest58115: has joined #RubyOnRails
[23:23:27] Guest58115: has joined #RubyOnRails
[23:28:51] havenwood: has joined #RubyOnRails
[23:33:19] Guest58115: has joined #RubyOnRails
[23:43:20] Guest58115: has joined #RubyOnRails
[23:52:47] prettybTech: has joined #RubyOnRails
[23:53:19] Guest58115: has joined #RubyOnRails