« Back to channel list

#RubyOnRails - 30 November 2017

« Back 1 day Forward 1 day »
[00:04:59] silvermine: has joined #RubyOnRails
[00:26:36] tcopeland: has joined #RubyOnRails
[00:31:33] Technodrome: has joined #RubyOnRails
[00:34:50] Jameser: has joined #RubyOnRails
[00:36:11] sevenseacat: has joined #RubyOnRails
[00:36:32] Vircung: has joined #RubyOnRails
[01:03:13] Ropeney: has joined #RubyOnRails
[01:06:36] ahrs: has joined #RubyOnRails
[01:07:08] orbyt_: has joined #RubyOnRails
[01:18:27] agent_white: has joined #RubyOnRails
[01:22:07] truenito: has joined #RubyOnRails
[01:30:06] fragamus: has joined #RubyOnRails
[01:30:15] alexertech: has joined #RubyOnRails
[01:30:44] drowze: has joined #RubyOnRails
[01:33:59] drowze: has joined #RubyOnRails
[01:34:54] fragamus: has joined #RubyOnRails
[01:43:47] Olipro: has joined #RubyOnRails
[02:01:36] MrCrackPotBuilde: has joined #RubyOnRails
[02:10:22] fragamus: has joined #RubyOnRails
[02:15:02] fragamus: has joined #RubyOnRails
[02:25:05] quirkycoders: has joined #RubyOnRails
[02:25:06] DTZUZO: has joined #RubyOnRails
[02:27:46] quirkycoders: has joined #RubyOnRails
[02:36:36] Vircung: has joined #RubyOnRails
[02:41:14] workmad3_: has joined #RubyOnRails
[02:42:24] urk187: has joined #RubyOnRails
[02:43:56] Olipro: has joined #RubyOnRails
[02:45:10] urk187: has joined #RubyOnRails
[02:48:18] quirkycoders: has joined #RubyOnRails
[02:55:38] fragamus: has joined #RubyOnRails
[02:56:12] urk187: has joined #RubyOnRails
[03:01:39] urk187: has joined #RubyOnRails
[03:04:01] urk187: has joined #RubyOnRails
[03:10:50] Exhiled: has joined #RubyOnRails
[03:11:26] fragamus: has joined #RubyOnRails
[03:13:24] truenito: has joined #RubyOnRails
[03:15:14] memo1: has joined #RubyOnRails
[03:17:35] memo1: Hi, i deploy my rail app in 2 heroku servers (production and staging). Im using actioncable, son the staging app is looking for the ws of production and is failing. Is like the staging app is looking for production setting. I set correctly the staing and production variables. Please help
[03:31:26] Olipro: has joined #RubyOnRails
[03:41:50] urk187: has joined #RubyOnRails
[03:42:10] urk187: has joined #RubyOnRails
[03:42:45] urk187: has joined #RubyOnRails
[03:43:40] urk187: has joined #RubyOnRails
[03:43:58] urk187: has joined #RubyOnRails
[03:44:33] urk187: has joined #RubyOnRails
[03:45:28] urk187: has joined #RubyOnRails
[03:46:24] urk187: has joined #RubyOnRails
[03:46:39] urk187: has joined #RubyOnRails
[03:47:34] urk187: has joined #RubyOnRails
[03:48:09] urk187: has joined #RubyOnRails
[03:49:04] urk187: has joined #RubyOnRails
[03:49:59] urk187: has joined #RubyOnRails
[03:50:14] urk187: has joined #RubyOnRails
[03:50:53] urk187: has joined #RubyOnRails
[03:51:48] urk187: has joined #RubyOnRails
[03:52:57] urk187: has joined #RubyOnRails
[03:53:52] urk187: has joined #RubyOnRails
[03:54:27] urk187: has joined #RubyOnRails
[03:55:39] urk187: has joined #RubyOnRails
[03:56:14] urk187: has joined #RubyOnRails
[03:57:09] urk187: has joined #RubyOnRails
[03:58:04] urk187: has joined #RubyOnRails
[03:58:59] urk187: has joined #RubyOnRails
[03:59:52] urk187: has joined #RubyOnRails
[04:00:47] urk187: has joined #RubyOnRails
[04:01:02] urk187: has joined #RubyOnRails
[04:02:35] urk187: has joined #RubyOnRails
[04:03:27] urk187: has joined #RubyOnRails
[04:04:22] urk187: has joined #RubyOnRails
[04:05:17] urk187: has joined #RubyOnRails
[04:06:12] urk187: has joined #RubyOnRails
[04:06:27] urk187: has joined #RubyOnRails
[04:07:22] urk187: has joined #RubyOnRails
[04:07:59] urk187: has joined #RubyOnRails
[04:08:54] urk187: has joined #RubyOnRails
[04:09:09] urk187: has joined #RubyOnRails
[04:10:42] urk187: has joined #RubyOnRails
[04:10:57] urk187: has joined #RubyOnRails
[04:11:52] urk187: has joined #RubyOnRails
[04:12:27] urk187: has joined #RubyOnRails
[04:13:22] urk187: has joined #RubyOnRails
[04:14:17] urk187: has joined #RubyOnRails
[04:14:34] urk187: has joined #RubyOnRails
[04:14:48] SteenJobs: has joined #RubyOnRails
[04:15:09] urk187: has joined #RubyOnRails
[04:16:04] urk187: has joined #RubyOnRails
[04:16:56] urk187: has joined #RubyOnRails
[04:17:51] urk187: has joined #RubyOnRails
[04:17:55] quazimodo: has joined #RubyOnRails
[04:18:31] fragamus: has joined #RubyOnRails
[04:18:47] urk187: has joined #RubyOnRails
[04:19:02] urk187: has joined #RubyOnRails
[04:19:57] urk187: has joined #RubyOnRails
[04:20:32] urk187: has joined #RubyOnRails
[04:21:26] urk187: has joined #RubyOnRails
[04:22:21] urk187: has joined #RubyOnRails
[04:23:17] urk187: has joined #RubyOnRails
[04:23:32] urk187: has joined #RubyOnRails
[04:24:27] urk187: has joined #RubyOnRails
[04:25:02] urk187: has joined #RubyOnRails
[04:25:57] urk187: has joined #RubyOnRails
[04:26:52] urk187: has joined #RubyOnRails
[04:27:47] urk187: has joined #RubyOnRails
[04:28:39] urk187: has joined #RubyOnRails
[04:29:34] urk187: has joined #RubyOnRails
[04:30:46] urk187: has joined #RubyOnRails
[04:32:16] urk187: has joined #RubyOnRails
[04:33:11] urk187: has joined #RubyOnRails
[04:34:06] urk187: has joined #RubyOnRails
[04:34:59] urk187: has joined #RubyOnRails
[04:35:54] urk187: has joined #RubyOnRails
[04:36:09] urk187: has joined #RubyOnRails
[04:36:42] Vircung: has joined #RubyOnRails
[04:37:04] urk187: has joined #RubyOnRails
[04:37:39] urk187: has joined #RubyOnRails
[04:38:34] urk187: has joined #RubyOnRails
[04:39:40] fragamus: has joined #RubyOnRails
[04:39:46] urk187: has joined #RubyOnRails
[04:41:16] urk187: has joined #RubyOnRails
[04:42:09] urk187: has joined #RubyOnRails
[04:43:04] urk187: has joined #RubyOnRails
[04:43:59] urk187: has joined #RubyOnRails
[04:44:54] urk187: has joined #RubyOnRails
[04:45:09] urk187: has joined #RubyOnRails
[04:46:04] urk187: has joined #RubyOnRails
[04:46:39] urk187: has joined #RubyOnRails
[04:46:55] fragamus: has joined #RubyOnRails
[04:47:34] urk187: has joined #RubyOnRails
[04:48:29] urk187: has joined #RubyOnRails
[04:49:24] urk187: has joined #RubyOnRails
[04:50:33] urk187: has joined #RubyOnRails
[04:51:08] urk187: has joined #RubyOnRails
[04:52:03] urk187: has joined #RubyOnRails
[04:52:59] urk187: has joined #RubyOnRails
[04:53:54] urk187: has joined #RubyOnRails
[04:54:09] urk187: has joined #RubyOnRails
[04:54:18] yonahw: has joined #RubyOnRails
[04:55:58] urk187: has joined #RubyOnRails
[04:56:33] urk187: has joined #RubyOnRails
[04:57:28] urk187: has joined #RubyOnRails
[04:58:23] urk187: has joined #RubyOnRails
[04:59:18] urk187: has joined #RubyOnRails
[04:59:34] urk187: has joined #RubyOnRails
[05:00:09] urk187: has joined #RubyOnRails
[05:01:04] urk187: has joined #RubyOnRails
[05:02:00] urk187: has joined #RubyOnRails
[05:03:10] urk187: has joined #RubyOnRails
[05:05:52] urk187: has joined #RubyOnRails
[05:06:27] urk187: has joined #RubyOnRails
[05:07:22] urk187: has joined #RubyOnRails
[05:08:18] urk187: has joined #RubyOnRails
[05:08:35] urk187: has joined #RubyOnRails
[05:10:05] urk187: has joined #RubyOnRails
[05:10:57] urk187: has joined #RubyOnRails
[05:11:52] urk187: has joined #RubyOnRails
[05:12:48] urk187: has joined #RubyOnRails
[05:13:04] urk187: has joined #RubyOnRails
[05:13:39] urk187: has joined #RubyOnRails
[05:14:34] urk187: has joined #RubyOnRails
[05:15:29] urk187: has joined #RubyOnRails
[05:16:24] urk187: has joined #RubyOnRails
[05:16:39] urk187: has joined #RubyOnRails
[05:17:34] urk187: has joined #RubyOnRails
[05:18:09] urk187: has joined #RubyOnRails
[05:19:04] urk187: has joined #RubyOnRails
[05:19:13] silvermine: has joined #RubyOnRails
[05:19:24] sunya7a_: hi, I have a call back (after_create) that is meant to create some additional resources but for reasons beyond me it is firing twice. anyone know why this might happen? https://gist.github.com/anonymous/06e67b1226850531f72b25df719c6ecf
[05:20:16] urk187: has joined #RubyOnRails
[05:20:22] iamarun: has joined #RubyOnRails
[05:21:46] urk187: has joined #RubyOnRails
[05:22:04] urk187: has joined #RubyOnRails
[05:23:34] urk187: has joined #RubyOnRails
[05:24:29] urk187: has joined #RubyOnRails
[05:25:24] urk187: has joined #RubyOnRails
[05:25:39] urk187: has joined #RubyOnRails
[05:27:13] urk187: has joined #RubyOnRails
[05:27:27] urk187: has joined #RubyOnRails
[05:27:29] ur5us: has joined #RubyOnRails
[05:28:11] dminuoso: sunya7a_: Your autoloading could be screwed up or you are explicitly requiring that class.
[05:28:22] urk187: has joined #RubyOnRails
[05:28:59] urk187: has joined #RubyOnRails
[05:29:22] dminuoso: Im not exactly sure whether you shouldn't already notice it, but that would cause after_create to be executed twice.
[05:29:54] urk187: has joined #RubyOnRails
[05:30:01] dminuoso: sunya7a_: Can you check the backtrace on both times its called?
[05:30:09] urk187: has joined #RubyOnRails
[05:30:35] MrCrackPotBuilde: has joined #RubyOnRails
[05:31:04] urk187: has joined #RubyOnRails
[05:32:34] urk187: has joined #RubyOnRails
[05:33:29] urk187: has joined #RubyOnRails
[05:35:59] sunya7a_: dminuoso: I'm trying to step through the code...the first time my measure resource is added is during my loop...as I step through further rails is calling something inside active_support/callbacks.rb, during which measure i see active record insert the measures again. Is that what you are referring to, that autoloading being screwed up? Could you tell me why that happens or give me some resource to read up on this?
[05:36:12] urk187: has joined #RubyOnRails
[05:36:57] sunya7a_: dminuoso: I'm not sure i understand what you mean with I "shouldn't already notice it". you mean this problem would have manifested itself somewhere else already?
[05:37:42] sunya7a_: dminuoso: i believe this is the first time I see it happen. I use after_create quite frequently in other models...only this time it's behaving this way
[05:37:57] urk187: has joined #RubyOnRails
[05:38:22] conta: has joined #RubyOnRails
[05:38:52] urk187: has joined #RubyOnRails
[05:39:47] urk187: has joined #RubyOnRails
[05:40:39] urk187: has joined #RubyOnRails
[05:41:34] urk187: has joined #RubyOnRails
[05:42:28] urk187: has joined #RubyOnRails
[05:42:34] mtkd: has joined #RubyOnRails
[05:43:22] urk187: has joined #RubyOnRails
[05:44:17] urk187: has joined #RubyOnRails
[05:45:12] urk187: has joined #RubyOnRails
[05:45:27] urk187: has joined #RubyOnRails
[05:46:07] urk187: has joined #RubyOnRails
[05:46:22] urk187: has joined #RubyOnRails
[05:46:59] urk187: has joined #RubyOnRails
[05:47:54] urk187: has joined #RubyOnRails
[05:48:09] urk187: has joined #RubyOnRails
[05:49:04] urk187: has joined #RubyOnRails
[05:51:27] urk187: has joined #RubyOnRails
[05:51:54] fourcolors: has joined #RubyOnRails
[05:52:22] urk187: has joined #RubyOnRails
[05:53:17] urk187: has joined #RubyOnRails
[05:54:11] urk187: has joined #RubyOnRails
[05:54:26] urk187: has joined #RubyOnRails
[05:55:06] urk187: has joined #RubyOnRails
[05:55:21] urk187: has joined #RubyOnRails
[05:55:57] urk187: has joined #RubyOnRails
[05:56:52] urk187: has joined #RubyOnRails
[05:57:47] urk187: has joined #RubyOnRails
[05:58:41] urk187: has joined #RubyOnRails
[05:59:36] urk187: has joined #RubyOnRails
[05:59:51] urk187: has joined #RubyOnRails
[06:00:29] urk187: has joined #RubyOnRails
[06:00:44] urk187: has joined #RubyOnRails
[06:00:50] fourcolors: has joined #RubyOnRails
[06:01:24] urk187: has joined #RubyOnRails
[06:01:39] urk187: has joined #RubyOnRails
[06:02:05] fourcolors: has joined #RubyOnRails
[06:03:12] urk187: has joined #RubyOnRails
[06:04:22] urk187: has joined #RubyOnRails
[06:05:17] urk187: has joined #RubyOnRails
[06:05:52] urk187: has joined #RubyOnRails
[06:06:47] urk187: has joined #RubyOnRails
[06:07:42] urk187: has joined #RubyOnRails
[06:07:57] urk187: has joined #RubyOnRails
[06:08:37] urk187: has joined #RubyOnRails
[06:08:52] urk187: has joined #RubyOnRails
[06:09:47] urk187: has joined #RubyOnRails
[06:10:22] urk187: has joined #RubyOnRails
[06:11:17] urk187: has joined #RubyOnRails
[06:11:23] reber: has joined #RubyOnRails
[06:11:34] urk187: has joined #RubyOnRails
[06:12:09] urk187: has joined #RubyOnRails
[06:13:04] urk187: has joined #RubyOnRails
[06:13:59] urk187: has joined #RubyOnRails
[06:14:54] urk187: has joined #RubyOnRails
[06:16:42] urk187: has joined #RubyOnRails
[06:16:57] urk187: has joined #RubyOnRails
[06:17:37] urk187: has joined #RubyOnRails
[06:17:52] urk187: has joined #RubyOnRails
[06:19:22] urk187: has joined #RubyOnRails
[06:20:17] urk187: has joined #RubyOnRails
[06:21:12] urk187: has joined #RubyOnRails
[06:21:27] urk187: has joined #RubyOnRails
[06:22:22] urk187: has joined #RubyOnRails
[06:23:16] urk187: has joined #RubyOnRails
[06:23:51] urk187: has joined #RubyOnRails
[06:24:31] srinidhi: has joined #RubyOnRails
[06:24:46] urk187: has joined #RubyOnRails
[06:25:04] urk187: has joined #RubyOnRails
[06:25:59] urk187: has joined #RubyOnRails
[06:26:34] urk187: has joined #RubyOnRails
[06:27:27] urk187: has joined #RubyOnRails
[06:27:47] urk187: has joined #RubyOnRails
[06:28:22] urk187: has joined #RubyOnRails
[06:29:17] urk187: has joined #RubyOnRails
[06:29:34] urk187: has joined #RubyOnRails
[06:31:04] urk187: has joined #RubyOnRails
[06:32:16] urk187: has joined #RubyOnRails
[06:32:51] urk187: has joined #RubyOnRails
[06:33:46] urk187: has joined #RubyOnRails
[06:35:17] srinidhi: has joined #RubyOnRails
[06:35:36] urk187: has joined #RubyOnRails
[06:36:46] urk187: has joined #RubyOnRails
[06:36:47] Vircung: has joined #RubyOnRails
[06:38:16] urk187: has joined #RubyOnRails
[06:38:56] cschneid_: has joined #RubyOnRails
[06:39:12] urk187: has joined #RubyOnRails
[06:40:07] urk187: has joined #RubyOnRails
[06:40:22] urk187: has joined #RubyOnRails
[06:41:16] urk187: has joined #RubyOnRails
[06:42:46] urk187: has joined #RubyOnRails
[06:43:42] urk187: has joined #RubyOnRails
[06:43:57] urk187: has joined #RubyOnRails
[06:44:32] urk187: has joined #RubyOnRails
[06:44:52] urk187: has joined #RubyOnRails
[06:45:29] urk187: has joined #RubyOnRails
[06:45:37] sunya7a_: dminuoso: so I printed the backtrace and it is indeed being called twice...i don't understand why.
[06:45:59] sunya7a_: dminuoso: the fix is to go about creating the resource in the join resource...instead of the measure
[06:46:13] KeyJoo: has joined #RubyOnRails
[06:46:24] urk187: has joined #RubyOnRails
[06:46:27] quazimodo: has joined #RubyOnRails
[06:46:29] sunya7a_: dminuoso: https://gist.github.com/anonymous/9d0e3e640a370fb0afe3073bd5710978 the top version works...the bottom doesn't....could you help me understand this...is it a rails bug?
[06:47:19] urk187: has joined #RubyOnRails
[06:47:35] urk187: has joined #RubyOnRails
[06:47:46] fourcolors: has joined #RubyOnRails
[06:48:10] urk187: has joined #RubyOnRails
[06:49:59] urk187: has joined #RubyOnRails
[06:50:55] urk187: has joined #RubyOnRails
[06:51:10] urk187: has joined #RubyOnRails
[06:52:55] dminuoso: sunya7a_: Like I said, please drop a binding.pry/byebug at the class level of this class, kill spring, and restart your application.
[06:52:58] urk187: has joined #RubyOnRails
[06:53:03] dminuoso: (Or use Rails.logger)
[06:53:13] dminuoso: And trigger the situation.
[06:54:30] urk187: has joined #RubyOnRails
[06:55:25] urk187: has joined #RubyOnRails
[06:55:40] urk187: has joined #RubyOnRails
[06:56:20] urk187: has joined #RubyOnRails
[06:57:19] urk187: has joined #RubyOnRails
[06:57:34] urk187: has joined #RubyOnRails
[06:58:29] urk187: has joined #RubyOnRails
[06:59:23] urk187: has joined #RubyOnRails
[06:59:50] sunya7a_: dminuoso: okay ... i did that...stopped rails server...stopped spring...placed bybug inside the class just below class ResultStatisticSection < ApplicationRecord line...then triggered the situation...i was dropped into debug mode once...pressed c to continue...didn't drop into debug mode again...rails created twice the record i expected. were you expecting it to drop into debug mode twice, thus explaining the double laoding?
[07:00:53] urk187: has joined #RubyOnRails
[07:01:10] urk187: has joined #RubyOnRails
[07:01:40] dminuoso: sunya7a_: Can you please show the full backtrace for *both* times the callback is triggered?
[07:02:05] urk187: has joined #RubyOnRails
[07:02:11] dminuoso: sunya7a_: Also inspect ResultStatisticSection._save_callbacks
[07:02:40] urk187: has joined #RubyOnRails
[07:02:53] dminuoso: sunya7a_: Furthermore, scan your repository to see if you accidentally duplicated the class definition.
[07:03:09] dminuoso: (Which I reckon could have the same effect if the classes were preloaded)
[07:03:35] urk187: has joined #RubyOnRails
[07:06:17] urk187: has joined #RubyOnRails
[07:07:12] urk187: has joined #RubyOnRails
[07:07:27] urk187: has joined #RubyOnRails
[07:08:22] urk187: has joined #RubyOnRails
[07:08:57] urk187: has joined #RubyOnRails
[07:09:52] urk187: has joined #RubyOnRails
[07:10:10] urk187: has joined #RubyOnRails
[07:10:45] urk187: has joined #RubyOnRails
[07:11:40] urk187: has joined #RubyOnRails
[07:12:36] urk187: has joined #RubyOnRails
[07:12:51] urk187: has joined #RubyOnRails
[07:13:46] urk187: has joined #RubyOnRails
[07:14:21] urk187: has joined #RubyOnRails
[07:14:40] urk187: has joined #RubyOnRails
[07:15:35] urk187: has joined #RubyOnRails
[07:16:10] urk187: has joined #RubyOnRails
[07:16:15] sunya7a_: dminuoso: here's a print out of inspecting ResultStatisticSection._save_callbacks, I grep'ed through the app and found the class defined only once (also in gist). Furthermore, it doesn't actually seem like the after_create is called twice, instead after_create is called once...then it goes through the loop of my method to add the measures and when it finishes it goes back into active_support/callbacks.rb:456 and runs whatever is inside @after
[07:16:22] sunya7a_: dminuoso: https://gist.github.com/anonymous/979ccd1a413950ca34d62edc3ec40821
[07:17:23] urk187: has joined #RubyOnRails
[07:17:27] sunya7a_: dminuoso: please have a look at my comments in def create_default_descriptive_statistics . doing it one way creates double records...the otherway does it correctly. i'm just not sure why
[07:17:58] urk187: has joined #RubyOnRails
[07:18:53] urk187: has joined #RubyOnRails
[07:18:55] sunya7a_: dminuoso: i'm sorry...i should have inspected after I declared the callback...let me update the gist
[07:19:27] sunya7a_: dminuoso: https://gist.github.com/anonymous/a59f8e5dda2f4d58b368a526fd1aabdf
[07:20:00] sunya7a_: dminuoso: only the p ResultStatisticSection._save_callbacks is different in this gist...the rest is the same
[07:20:43] urk187: has joined #RubyOnRails
[07:20:58] urk187: has joined #RubyOnRails
[07:21:02] fragamus: has joined #RubyOnRails
[07:21:36] urk187: has joined #RubyOnRails
[07:22:31] urk187: has joined #RubyOnRails
[07:22:46] urk187: has joined #RubyOnRails
[07:24:16] urk187: has joined #RubyOnRails
[07:25:11] urk187: has joined #RubyOnRails
[07:26:23] urk187: has joined #RubyOnRails
[07:26:58] urk187: has joined #RubyOnRails
[07:27:47] AzaToth: has joined #RubyOnRails
[07:27:53] urk187: has joined #RubyOnRails
[07:28:48] urk187: has joined #RubyOnRails
[07:29:42] conta: has joined #RubyOnRails
[07:29:43] urk187: has joined #RubyOnRails
[07:29:58] urk187: has joined #RubyOnRails
[07:30:37] urk187: has joined #RubyOnRails
[07:30:52] urk187: has joined #RubyOnRails
[07:31:47] urk187: has joined #RubyOnRails
[07:32:22] urk187: has joined #RubyOnRails
[07:33:00] dminuoso: sunya7a_: How do they differ?
[07:33:19] urk187: has joined #RubyOnRails
[07:34:22] dminuoso: sunya7a_: Id also like to see the Measure model
[07:34:29] urk187: has joined #RubyOnRails
[07:35:19] dminuoso: sunya7a_: And I cant see the backtraces for both times the method is called.
[07:35:22] urk187: has joined #RubyOnRails
[07:35:32] _vircung_: has joined #RubyOnRails
[07:35:38] dminuoso: I want to know which code triggers each invocation of the callback.
[07:35:57] urk187: has joined #RubyOnRails
[07:36:52] urk187: has joined #RubyOnRails
[07:37:47] urk187: has joined #RubyOnRails
[07:38:42] urk187: has joined #RubyOnRails
[07:38:57] urk187: has joined #RubyOnRails
[07:39:16] sunya7a_: dminuoso: https://gist.github.com/anonymous/a7799ed88223687dcc72c78110383ec7 this is with measure.rb
[07:39:36] urk187: has joined #RubyOnRails
[07:39:45] sunya7a_: dminuoso: i see...let me get one more model then...one sec
[07:40:46] urk187: has joined #RubyOnRails
[07:40:52] sunya7a_: dminuoso: https://gist.github.com/anonymous/74bf4404844783bb2cb029894e8407d2
[07:41:19] mixnblend: has joined #RubyOnRails
[07:42:18] urk187: has joined #RubyOnRails
[07:43:22] sunya7a_: dminuoso: does this make sense?
[07:43:28] urk187: has joined #RubyOnRails
[07:44:07] urk187: has joined #RubyOnRails
[07:44:22] urk187: has joined #RubyOnRails
[07:45:17] urk187: has joined #RubyOnRails
[07:45:52] urk187: has joined #RubyOnRails
[07:45:57] sunya7a_: dminuoso: as ExtractionsExtractionFormsProjectsSectionsType1RowColumn is created I create 4 default ResultStatisticSection. This in turn checks its type and if it matches the first type it iterates through measures and adds the default ones as well. I alias that long class name to subgroup.
[07:46:43] mtkd: has joined #RubyOnRails
[07:46:47] urk187: has joined #RubyOnRails
[07:47:42] urk187: has joined #RubyOnRails
[07:48:35] urk187: has joined #RubyOnRails
[07:49:05] dminuoso: sunya7a_: Stop making more gists. You can create multiple file per gist, and you can edit them if you sign up.
[07:49:18] sunya7a_: dminuoso: ok
[07:49:30] urk187: has joined #RubyOnRails
[07:50:40] urk187: has joined #RubyOnRails
[07:51:47] dminuoso: sunya7a_: Now for each physical file, use a separate "file" in gist using a descriptive name. Include the models: Measure, ResultStatisticSection (in the buggy form only!), and result_statistic_sections_measures
[07:52:10] urk187: has joined #RubyOnRails
[07:52:46] dminuoso: Any log or debug output goes into separate files (or perhaps a separate gist)
[07:53:03] dminuoso: If we need to include more, you just edit the previous gist and attach any additional files requested, so I dont have to keep track of a gazillion gists.
[07:53:05] urk187: has joined #RubyOnRails
[07:53:40] srinidhi: has joined #RubyOnRails
[07:54:01] urk187: has joined #RubyOnRails
[07:54:16] urk187: has joined #RubyOnRails
[07:54:51] DrYockel: has joined #RubyOnRails
[07:55:58] sunya7a_: dminuoso: https://gist.github.com/sunya7a/519cc67e0a56311e65e3611dc29a65b5
[07:56:05] urk187: has joined #RubyOnRails
[07:56:17] sunya7a_: dminuoso: thanks for the tip
[07:57:35] urk187: has joined #RubyOnRails
[07:58:30] urk187: has joined #RubyOnRails
[07:59:03] dminuoso: sunya7a_: So. What are you doing in code, and what effect are you observing?
[07:59:25] urk187: has joined #RubyOnRails
[08:00:17] quazimodo: has joined #RubyOnRails
[08:00:18] urk187: has joined #RubyOnRails
[08:00:33] urk187: has joined #RubyOnRails
[08:01:28] urk187: has joined #RubyOnRails
[08:01:57] Dimik: has joined #RubyOnRails
[08:02:33] sunya7a_: dminuoso: so what i'm trying to accomplish is add default measures to a specific type of ResultStatisticSection. ResultStatisticSection has many-to-many relationship with Measure via a join model. A ResultStatisticSection is created when ExtractionsExtractionFormsProjectsSectionsType1RowColumn (aka subgroup) is created via after_create callback
[08:03:00] urk187: has joined #RubyOnRails
[08:03:03] sevenseacat: ACTION blinks
[08:03:20] sunya7a_: sevenseacat: =(
[08:03:29] sunya7a_: dminuoso: when i do self.measures << m in my code
[08:03:31] sevenseacat: that's a hell of a class name
[08:03:46] dminuoso: sunya7a_: No! Please give me the actual code of the callsite that triggers everything.
[08:04:10] urk187: has joined #RubyOnRails
[08:05:40] urk187: has joined #RubyOnRails
[08:06:34] urk187: has joined #RubyOnRails
[08:06:36] sunya7a_: dminuoso: i updated the gist with the controller action that I'm calling
[08:07:06] sunya7a_: I am making an update to another resource called ExtractionsExtractionFormsProjectsSections
[08:07:09] sunya7a_: sevenseacat: =(
[08:07:12] dminuoso: ExtractionsExtractionFormsProjectsSectionsController :|
[08:07:29] urk187: has joined #RubyOnRails
[08:08:08] sevenseacat: dont confuse it with the ExtractionsExtractionFormsSectionsProjectsController. *very* important.
[08:08:24] urk187: has joined #RubyOnRails
[08:08:29] dminuoso: sunya7a_: So which line of code triggers the bad behavior?
[08:08:39] urk187: has joined #RubyOnRails
[08:09:19] urk187: has joined #RubyOnRails
[08:09:34] urk187: has joined #RubyOnRails
[08:10:09] urk187: has joined #RubyOnRails
[08:10:29] urk187: has joined #RubyOnRails
[08:11:05] sunya7a_: dminuoso: idk exactly which line causes the bad behavior...in my opinion it should work...line 24 in result_statistic_section.rb does exactly what I want it to...but then once that method is called rails goes back into active_support/callback.rb and triggers the insert a second time and I don't know why it does that...but somehow when I create the join resource instead of doing measures << m on that same line it doesn't insert twice
[08:11:05] urk187: has joined #RubyOnRails
[08:11:40] sunya7a_: 'once that method is called' meaning once it's done...it goes into callback.rb and does the insert again
[08:12:00] urk187: has joined #RubyOnRails
[08:12:11] dminuoso: sunya7a_: I want to know the call site in your controller.
[08:12:15] urk187: has joined #RubyOnRails
[08:12:35] dminuoso: sunya7a_: You said "I end up with 2 records". Show me the ruby code you call to provoke that behavior.
[08:12:38] dminuoso: Now the implementation.
[08:12:44] sunya7a_: dminuoso: that should be line 11: @extractions_extraction_forms_projects_section.update(extractions_extraction_forms_projects_section_params)
[08:13:16] sunya7a_: line 11 in the controller.rb
[08:13:49] urk187: has joined #RubyOnRails
[08:14:04] urk187: has joined #RubyOnRails
[08:14:06] dminuoso: Make a testcase.
[08:14:47] sunya7a_: dminuoso: ok
[08:14:59] urk187: has joined #RubyOnRails
[08:15:32] dminuoso: sunya7a_: See if you can somehow show this using ruby code directly using <<. If you can, delete any code that seems irrelevant.
[08:15:34] urk187: has joined #RubyOnRails
[08:15:49] dminuoso: If the problem disappears, you deleted too much.
[08:16:29] urk187: has joined #RubyOnRails
[08:17:24] urk187: has joined #RubyOnRails
[08:18:18] urk187: has joined #RubyOnRails
[08:19:13] urk187: has joined #RubyOnRails
[08:19:28] urk187: has joined #RubyOnRails
[08:20:06] urk187: has joined #RubyOnRails
[08:21:16] urk187: has joined #RubyOnRails
[08:22:10] urk187: has joined #RubyOnRails
[08:23:05] urk187: has joined #RubyOnRails
[08:23:40] urk187: has joined #RubyOnRails
[08:24:09] ur5us: has joined #RubyOnRails
[08:24:36] urk187: has joined #RubyOnRails
[08:25:31] urk187: has joined #RubyOnRails
[08:25:46] urk187: has joined #RubyOnRails
[08:26:00] cschneid_: has joined #RubyOnRails
[08:26:40] urk187: has joined #RubyOnRails
[08:26:52] sonOfRa: has joined #RubyOnRails
[08:28:10] urk187: has joined #RubyOnRails
[08:29:08] urk187: has joined #RubyOnRails
[08:29:23] urk187: has joined #RubyOnRails
[08:29:43] DoubleMalt: has joined #RubyOnRails
[08:29:58] urk187: has joined #RubyOnRails
[08:30:53] urk187: has joined #RubyOnRails
[08:31:11] urk187: has joined #RubyOnRails
[08:31:46] urk187: has joined #RubyOnRails
[08:32:06] urk187: has joined #RubyOnRails
[08:32:41] urk187: has joined #RubyOnRails
[08:33:52] urk187: has joined #RubyOnRails
[08:34:27] urk187: has joined #RubyOnRails
[08:35:22] urk187: has joined #RubyOnRails
[08:36:18] urk187: has joined #RubyOnRails
[08:36:35] MrCrackPotBuilde: has joined #RubyOnRails
[08:37:13] urk187: has joined #RubyOnRails
[08:38:22] urk187: has joined #RubyOnRails
[08:38:58] urk187: has joined #RubyOnRails
[08:39:17] urk187: has joined #RubyOnRails
[08:39:25] marr: has joined #RubyOnRails
[08:39:52] urk187: has joined #RubyOnRails
[08:40:47] urk187: has joined #RubyOnRails
[08:40:50] defsdoor: has joined #RubyOnRails
[08:41:42] urk187: has joined #RubyOnRails
[08:41:57] urk187: has joined #RubyOnRails
[08:42:53] urk187: has joined #RubyOnRails
[08:43:28] urk187: has joined #RubyOnRails
[08:44:23] urk187: has joined #RubyOnRails
[08:45:17] urk187: has joined #RubyOnRails
[08:46:12] urk187: has joined #RubyOnRails
[08:46:27] urk187: has joined #RubyOnRails
[08:47:07] urk187: has joined #RubyOnRails
[08:47:22] urk187: has joined #RubyOnRails
[08:48:17] urk187: has joined #RubyOnRails
[08:48:52] urk187: has joined #RubyOnRails
[08:49:09] urk187: has joined #RubyOnRails
[08:50:05] urk187: has joined #RubyOnRails
[08:50:39] urk187: has joined #RubyOnRails
[08:50:59] urk187: has joined #RubyOnRails
[08:51:53] urk187: has joined #RubyOnRails
[08:52:28] urk187: has joined #RubyOnRails
[08:53:23] urk187: has joined #RubyOnRails
[08:53:41] urk187: has joined #RubyOnRails
[08:54:16] urk187: has joined #RubyOnRails
[08:55:11] urk187: has joined #RubyOnRails
[08:55:34] dionysus70: has joined #RubyOnRails
[08:55:56] dionysus70: I have an action called by paypal/js, i try to do this in the action redirect_to root_path, format: "html" but it still tries to render json, and I obviously have html to return for the root path, how do I force return html in a different way, if there's any
[08:56:04] urk187: has joined #RubyOnRails
[08:56:59] urk187: has joined #RubyOnRails
[08:57:54] urk187: has joined #RubyOnRails
[08:58:48] urk187: has joined #RubyOnRails
[08:59:07] jnollette: has joined #RubyOnRails
[08:59:42] urk187: has joined #RubyOnRails
[08:59:58] urk187: has joined #RubyOnRails
[09:00:34] urk187: has joined #RubyOnRails
[09:01:29] urk187: has joined #RubyOnRails
[09:02:24] urk187: has joined #RubyOnRails
[09:03:18] urk187: has joined #RubyOnRails
[09:04:13] urk187: has joined #RubyOnRails
[09:05:59] urk187: has joined #RubyOnRails
[09:06:54] urk187: has joined #RubyOnRails
[09:07:11] urk187: has joined #RubyOnRails
[09:07:46] urk187: has joined #RubyOnRails
[09:08:41] urk187: has joined #RubyOnRails
[09:09:36] urk187: has joined #RubyOnRails
[09:09:51] urk187: has joined #RubyOnRails
[09:10:31] urk187: has joined #RubyOnRails
[09:10:46] urk187: has joined #RubyOnRails
[09:11:41] urk187: has joined #RubyOnRails
[09:12:16] urk187: has joined #RubyOnRails
[09:13:11] urk187: has joined #RubyOnRails
[09:14:06] urk187: has joined #RubyOnRails
[09:14:21] urk187: has joined #RubyOnRails
[09:15:01] urk187: has joined #RubyOnRails
[09:15:16] urk187: has joined #RubyOnRails
[09:15:51] urk187: has joined #RubyOnRails
[09:16:12] urk187: has joined #RubyOnRails
[09:16:47] urk187: has joined #RubyOnRails
[09:17:42] urk187: has joined #RubyOnRails
[09:18:37] urk187: has joined #RubyOnRails
[09:20:18] quazimodo: has joined #RubyOnRails
[09:20:23] urk187: has joined #RubyOnRails
[09:21:19] urk187: has joined #RubyOnRails
[09:22:29] urk187: has joined #RubyOnRails
[09:23:03] urk187: has joined #RubyOnRails
[09:23:23] urk187: has joined #RubyOnRails
[09:23:58] urk187: has joined #RubyOnRails
[09:24:53] urk187: has joined #RubyOnRails
[09:25:50] urk187: has joined #RubyOnRails
[09:26:13] powrtoch: has joined #RubyOnRails
[09:27:00] urk187: has joined #RubyOnRails
[09:27:37] urk187: has joined #RubyOnRails
[09:27:52] urk187: has joined #RubyOnRails
[09:28:27] urk187: has joined #RubyOnRails
[09:28:47] urk187: has joined #RubyOnRails
[09:29:22] urk187: has joined #RubyOnRails
[09:30:19] urk187: has joined #RubyOnRails
[09:30:34] urk187: has joined #RubyOnRails
[09:31:29] urk187: has joined #RubyOnRails
[09:32:03] urk187: has joined #RubyOnRails
[09:32:23] urk187: has joined #RubyOnRails
[09:32:58] urk187: has joined #RubyOnRails
[09:33:53] urk187: has joined #RubyOnRails
[09:36:00] urk187: has joined #RubyOnRails
[09:36:34] urk187: has joined #RubyOnRails
[09:37:29] urk187: has joined #RubyOnRails
[09:38:24] urk187: has joined #RubyOnRails
[09:39:17] urk187: has joined #RubyOnRails
[09:40:47] helpa: has joined #RubyOnRails
[09:41:05] urk187: has joined #RubyOnRails
[09:42:00] urk187: has joined #RubyOnRails
[09:42:12] simmerz: has joined #RubyOnRails
[09:42:15] urk187: has joined #RubyOnRails
[09:42:55] urk187: has joined #RubyOnRails
[09:44:05] urk187: has joined #RubyOnRails
[09:44:40] urk187: has joined #RubyOnRails
[09:44:55] Seich: has joined #RubyOnRails
[09:46:29] urk187: has joined #RubyOnRails
[09:47:24] urk187: has joined #RubyOnRails
[09:47:39] urk187: has joined #RubyOnRails
[09:48:19] urk187: has joined #RubyOnRails
[09:48:34] urk187: has joined #RubyOnRails
[09:49:29] urk187: has joined #RubyOnRails
[09:50:07] urk187: has joined #RubyOnRails
[09:50:22] urk187: has joined #RubyOnRails
[09:50:57] urk187: has joined #RubyOnRails
[09:51:17] urk187: has joined #RubyOnRails
[09:51:52] urk187: has joined #RubyOnRails
[09:52:49] urk187: has joined #RubyOnRails
[09:53:44] urk187: has joined #RubyOnRails
[09:53:59] urk187: has joined #RubyOnRails
[09:55:29] urk187: has joined #RubyOnRails
[09:56:24] urk187: has joined #RubyOnRails
[09:57:19] urk187: has joined #RubyOnRails
[09:58:22] jnollette: has joined #RubyOnRails
[09:58:29] urk187: has joined #RubyOnRails
[09:59:07] urk187: has joined #RubyOnRails
[09:59:22] urk187: has joined #RubyOnRails
[10:00:17] urk187: has joined #RubyOnRails
[10:00:52] urk187: has joined #RubyOnRails
[10:01:22] quarters: has joined #RubyOnRails
[10:01:49] urk187: has joined #RubyOnRails
[10:02:14] quarters: hello. I was wondering if it's recommended to use react-rails to use react as a front end
[10:02:43] urk187: has joined #RubyOnRails
[10:02:59] urk187: has joined #RubyOnRails
[10:03:36] urk187: has joined #RubyOnRails
[10:05:26] urk187: has joined #RubyOnRails
[10:06:35] urk187: has joined #RubyOnRails
[10:06:39] jnollette: I'm curious about that as well
[10:07:29] urk187: has joined #RubyOnRails
[10:08:04] urk187: has joined #RubyOnRails
[10:08:24] urk187: has joined #RubyOnRails
[10:08:59] urk187: has joined #RubyOnRails
[10:09:04] dminuoso: quarters: It depennds.
[10:09:26] dminuoso: quarters: If you want a full separate SPA, detach from your rails project and start off with cra (or configure webpack by hand)
[10:09:39] dminuoso: If you want drop-in react components in some places react-rails is pretty great.
[10:10:11] urk187: has joined #RubyOnRails
[10:11:38] jhill: has joined #RubyOnRails
[10:11:41] urk187: has joined #RubyOnRails
[10:11:44] quarters: dminuoso: so my friend coded something in ruby on rails with angular as a front-end but I'm only interested in using the API for that app, whereas, yeah, I'd like to code a separate SPA with node backend
[10:11:53] quarters: I was wondering if that's kosher
[10:12:13] CustosLimen: has joined #RubyOnRails
[10:12:19] dminuoso: quarters: We've developed a rails API with a split off react frontend (separate directory outside of rails)
[10:12:35] dminuoso: Was the sane way to go because webpacker is a bit annoying if you need full control.
[10:12:36] urk187: has joined #RubyOnRails
[10:13:11] dminuoso: What API you pick is up to you, but if you want a full SPA then don't do this from rails. Any potential code sharing can be maintained by using git submodules/folders in repositories.
[10:13:31] urk187: has joined #RubyOnRails
[10:13:46] quarters: dminuoso: if I just use the rails app's API, what should I do with the front-end code that's already been written?
[10:13:54] quarters: the app is kind of dead atm
[10:14:01] quarters: and I have the source
[10:14:11] dminuoso: quarters: What do you mean? What do you want to keep on using?
[10:14:16] dminuoso: Both? Just the API? Just the frontend?
[10:14:23] quarters: dminuoso: just the API for that rails app
[10:14:24] urk187: has joined #RubyOnRails
[10:14:41] dminuoso: quarters: And you want to start using react?
[10:14:48] quarters: and I'd hit the endpoints of the rails api from my node server
[10:15:00] dminuoso: Why introduce a node server?
[10:15:09] dminuoso: If you already have a rails api, you can directly develop the react frontend against it.
[10:15:23] urk187: has joined #RubyOnRails
[10:15:25] ur5us: has joined #RubyOnRails
[10:15:25] newton: has joined #RubyOnRails
[10:15:25] Travis-42: has joined #RubyOnRails
[10:15:25] nickenchuggets: has joined #RubyOnRails
[10:15:25] Hosh: has joined #RubyOnRails
[10:15:25] BloodyMer: has joined #RubyOnRails
[10:15:25] Nitrodist: has joined #RubyOnRails
[10:16:14] urk187: has joined #RubyOnRails
[10:16:21] Travis-42: has joined #RubyOnRails
[10:16:21] quarters: your idea about a full separate SPA seems very appealing to me
[10:16:33] nickenchuggets: has joined #RubyOnRails
[10:17:01] dminuoso: quarters: With what I have learned, I recommend not splitting it off into an entire separate directory. Maintain some monorepo with some frontend/ backend/ folders (which enables you to share code like i18n json files)
[10:17:06] urk187: has joined #RubyOnRails
[10:17:34] dminuoso: But you treat them separately, so backend/ would be your rails app, and frontend/ would be your react app build with webpack, perhaps starting out with create-react-app
[10:18:01] urk187: has joined #RubyOnRails
[10:18:10] dminuoso: And if you go a bit further, you can do some cool tricks like exporting role manifests, routes to dynamically generate react code
[10:18:30] quarters: can c-r-a be easily placed on top of the rails app without having to shuffle files within the existing rails file structure?
[10:18:39] dminuoso: quarters: not ontop, you do it side-by-side.
[10:18:46] dminuoso: Dont mix them together, there's no advantage.
[10:19:11] dminuoso: quarters: The only reason webpacker does this, is because its plugged into sprockets
[10:19:11] urk187: has joined #RubyOnRails
[10:20:06] sunya7a_: dminuoso: ok...i created a test case...but the only thing i was able to do was reproduce the issue with the test...I decided to try something else...created a new app to show case the problem...i think this is rails behavior and it is either working as intended or a bug: https://github.com/sunya7a/rails-bug
[10:20:41] urk187: has joined #RubyOnRails
[10:20:46] dminuoso: sunya7a_: Great, thank you. Let me take a look.
[10:20:51] quarters: dminuoso: oh...so I think I get what you're saying now. create a new dir, in which I place the c-r-a folder and the rails project?
[10:20:59] urk187: has joined #RubyOnRails
[10:21:06] quarters: that way they're in the same repo
[10:21:10] dminuoso: sunya7a_: By the way, the statement "and it is either working as intended or a bug" is a tautology. ;p
[10:21:11] quarters: but also not mixing
[10:21:17] sunya7a_: dminuoso: please open rails console...then simply create an A
[10:21:18] sunya7a_: dminuoso: lol;
[10:21:43] dminuoso: quarters: right.
[10:21:54] urk187: has joined #RubyOnRails
[10:22:02] quarters: dminuoso: should i just leave the unused angular code in the rails app/views folder as is?
[10:22:21] dminuoso: quarters: Up to you. I would and open a branch to remove it.
[10:22:29] urk187: has joined #RubyOnRails
[10:22:37] moei: has joined #RubyOnRails
[10:22:58] jnollette: has joined #RubyOnRails
[10:23:41] dminuoso: quarters: At any rate, the code sharing is where things get interesting. Role manifests was the first major thing we wanted (since we wanted our server-defined roles to carry over into our react app)
[10:23:41] urk187: has joined #RubyOnRails
[10:23:44] quarters: dminuoso: yeah, I'd like to remove it, but am unsure as to where breakage would happen. Like can I just delete views wholesale without worrying about breaking the backend? Or is the frontend and backend files more modular in a rails project than I take it for?
[10:24:02] ur5us: has joined #RubyOnRails
[10:24:13] quarters: I haven't played with role manifests at all, but I'll definitely take that tack
[10:24:19] dminuoso: quarters: You can delete views wholesale.
[10:24:30] dminuoso: quarters: Of course requesting html pages will break.
[10:24:42] dminuoso: So your controllers need to be cleaned up
[10:25:11] urk187: has joined #RubyOnRails
[10:25:29] urk187: has joined #RubyOnRails
[10:25:33] quarters: and the only gem you introduced for that refactor was webpacker?
[10:25:41] dminuoso: quarters: nope?
[10:25:53] dminuoso: webpacker is just webpack tied into sprockets.
[10:26:00] dminuoso: (which is what react-rails is built upon)
[10:26:24] urk187: has joined #RubyOnRails
[10:26:27] dminuoso: Or actually Im not entirely sure whether its actually sprockets, but its sitting in the same corner.
[10:26:30] quarters: ok. so react-rails should be a good place to start
[10:26:37] dminuoso: thats my point, its not.
[10:26:42] dminuoso: Or not necessarily.
[10:26:50] quarters: so no new gems needed?
[10:26:59] urk187: has joined #RubyOnRails
[10:27:01] quarters: instead use a role manifest?
[10:27:01] dminuoso: quarters: If you go down the cra route, there's 0 coupling between your frontend and your backend.
[10:27:13] quarters: yeah, I'd like the 0 coupling very much
[10:27:36] quarters: ah so the cra route makes it unnecessary for me to use gems
[10:27:38] quarters: I get it ow
[10:27:49] quarters: that's super ideal
[10:27:50] dminuoso: quarters: Yes. You just dont tie it into rails in the first place.
[10:27:53] dminuoso: Rails will not know anything about react.
[10:27:59] dminuoso: It will just know that its an API.
[10:28:04] dminuoso: And give JSON.
[10:28:09] dminuoso: To whoever asks.
[10:28:11] urk187: has joined #RubyOnRails
[10:28:26] dminuoso: quarters: Of course it means you have two things to build and deploy.
[10:28:38] dminuoso: Because rails assets no longer knows about your react app.
[10:28:57] dminuoso: (We consider that an advantage, as its a bit tricky to control webpacker because its badly documented and weird)
[10:29:29] dminuoso: And create-react-app gives you fairly sane defaults. You can get away with a really minimal Dockerfile
[10:29:41] urk187: has joined #RubyOnRails
[10:29:43] quarters: yeah. I'd prefer to avoid using gems when possible
[10:29:49] dminuoso: quarters: Another major advantage of this setup is the speed of HMR.
[10:29:59] urk187: has joined #RubyOnRails
[10:30:00] dminuoso: With react-rails a HMR reload typically takes 2-3 seconds (which is frustrating)
[10:30:05] dminuoso: As opposed to the 100ms we try to maintain
[10:30:40] dminuoso: (Sometimes it would even take as much as 5 seconds)
[10:30:54] urk187: has joined #RubyOnRails
[10:31:05] quarters: I'm not familiar with HMR
[10:31:21] dminuoso: quarters: Imagine you have your website open, and you edit the view in the editor and hit save. And the change instantly becomes visible in the browser.
[10:31:26] dminuoso: No reloading, no refresh.
[10:31:29] urk187: has joined #RubyOnRails
[10:31:36] dminuoso: create-react-app has this out of the box (and so does react-rails)
[10:31:56] dminuoso: No commands executed either. :-)
[10:32:13] quarters: I've only seen this with rails apps
[10:32:24] urk187: has joined #RubyOnRails
[10:32:26] dminuoso: So with react-rails it causes a slow recompilation and full annoying page reload (which means full page rerender, react state loss)
[10:32:28] quarters: the react apps I've worked with needed to be manually refreshed
[10:33:11] dminuoso: If you go down the raw react route, it works without a page reload - and if you follow some tricks you can even maintain full application state.
[10:33:19] urk187: has joined #RubyOnRails
[10:33:58] jnollette: has joined #RubyOnRails
[10:34:06] quarters: if a react component is already a stateful one, but I have some properties that I'd like to keep out of the state object so that any changes to it don't trigger a re-render, would you advise against declaring such properties outside of state?
[10:34:14] urk187: has joined #RubyOnRails
[10:34:29] urk187: has joined #RubyOnRails
[10:34:46] quarters: kind of the wrong chan...but I figured while we're talking about react...
[10:35:21] dminuoso: quarters: We follow a pattern that I like to call "pure react"
[10:35:24] urk187: has joined #RubyOnRails
[10:35:42] dminuoso: Which means essentially you just use functional components as much as possible (with no component state or component lifecycle methods)
[10:35:59] urk187: has joined #RubyOnRails
[10:36:06] dminuoso: Oh wait. What do you mean?
[10:36:18] dminuoso: Why shouldn't a change trigger a rerender?
[10:36:54] urk187: has joined #RubyOnRails
[10:37:41] quarters: if I already implemented a class stateful component and had an object with used id numbers to track numbers that have been used to prevent duplicates for new list items, I'm not interested in having a component re-render whenever that object is updated with a new id number
[10:37:49] urk187: has joined #RubyOnRails
[10:38:06] dminuoso: quarters: is the id relevant for the component or its descendents?
[10:38:43] dminuoso: If yes, use sCU, if it obviously does not belong there. :-)
[10:38:44] urk187: has joined #RubyOnRails
[10:38:44] quarters: dminuoso: it isn't directly, but the id will be accessed from a property that IS kept in state eventually
[10:38:58] urk187: has joined #RubyOnRails
[10:39:02] dminuoso: quarters: Pass it down anyway because semantically it requires a rerender.
[10:39:19] dminuoso: quarters: You can use PureComponent and sCU in leafs down the tree that dont need it
[10:39:25] dminuoso: (To avoid a fully recursive rerender)
[10:39:43] dminuoso: Or rather any intermediate child that does not care about it would use sCU/PureComponent to block updates
[10:39:54] urk187: has joined #RubyOnRails
[10:40:11] dminuoso: That way you only re-render the exact branch that actually somehow needs to know that state.
[10:40:29] urk187: has joined #RubyOnRails
[10:40:58] dminuoso: quarters: Though honestly my recommendation is: Pass it blindly.
[10:41:00] quarters: I'm still trying to understand what you mean by maintaining full application state
[10:41:11] dminuoso: And wait for the profiler. sCU and PureComponent are often premature optimizations.
[10:41:24] urk187: has joined #RubyOnRails
[10:41:57] dminuoso: quarters: Okay so lets say you have a form with managed input fields.
[10:42:07] NL3limin4t0r: has joined #RubyOnRails
[10:42:10] dminuoso: Where the input state is kept in react components as state.
[10:42:19] urk187: has joined #RubyOnRails
[10:42:43] dminuoso: The most common way to do HMR is to just redo ReactDOM.render(...) which essentially destroys the entire react tree, and builds a new one. *All* react state is gone now.
[10:43:14] urk187: has joined #RubyOnRails
[10:43:14] dminuoso: Sometimes this is fine, sometimes its not. If you say you keep some authentication information in react components, each HMR (triggered by hitting save in your editor) would log you out, clear all forms, etc..
[10:43:29] urk187: has joined #RubyOnRails
[10:43:50] dminuoso: Since we do not keep any state inside React, nothing is lost when that happens, because the state is still there. Its just the view that has changed.
[10:44:18] dminuoso: (In reality we maintain a lot of micro state such as whether a dropdown is opened or not, so if you have a dropdown open and HMR triggers, then the dropdown is closed afterwards)]
[10:44:24] urk187: has joined #RubyOnRails
[10:44:38] dminuoso: Or whether a button is hovered
[10:44:59] urk187: has joined #RubyOnRails
[10:45:46] quarters: where would the state be kept in a raw react solution
[10:45:54] urk187: has joined #RubyOnRails
[10:46:31] quarters: oh, I think I get what you mean now
[10:47:41] urk187: has joined #RubyOnRails
[10:47:46] quarters: do you mean that, as opposed to react-rails which causes refreshes during HMRs, using react directly would prevent such refreshes thereby allowing us to have control over the application's state
[10:48:36] urk187: has joined #RubyOnRails
[10:48:54] urk187: has joined #RubyOnRails
[10:49:29] urk187: has joined #RubyOnRails
[10:50:24] urk187: has joined #RubyOnRails
[10:51:17] urk187: has joined #RubyOnRails
[10:52:12] urk187: has joined #RubyOnRails
[10:53:07] urk187: has joined #RubyOnRails
[10:53:24] urk187: has joined #RubyOnRails
[10:53:49] dminuoso: quarters: Anywhere you want
[10:53:59] urk187: has joined #RubyOnRails
[10:53:59] dminuoso: redux, observables
[10:54:39] dminuoso: Keeping react state-free is the best thing you can do to maintain rapid development speed, low need for tests (because if you decouple views from state, testing becomes *tons* easier)
[10:54:50] dminuoso: Its less error prone, easier to reason about
[10:54:54] urk187: has joined #RubyOnRails
[10:55:17] dminuoso: This HMR thing is rather just a consequence, our motivations for "pure react" are the ones I just listed.
[10:55:48] urk187: has joined #RubyOnRails
[10:56:44] urk187: has joined #RubyOnRails
[10:56:59] urk187: has joined #RubyOnRails
[10:58:31] urk187: has joined #RubyOnRails
[10:59:41] urk187: has joined #RubyOnRails
[11:01:07] quarters: dminuoso: how would a c-r-a based front-end be able to retrieve state if all of the components are functional stateless components?
[11:01:11] urk187: has joined #RubyOnRails
[11:02:06] urk187: has joined #RubyOnRails
[11:02:11] dminuoso: quarters: You dont keep state inside the react tree.
[11:02:24] urk187: has joined #RubyOnRails
[11:02:42] dminuoso: quarters: So our "frontend" is more than react. It's a combination of sagas, a global state store, observables and the react tree.
[11:02:53] dminuoso: the react tree derives its state from the state store and observables.
[11:02:59] urk187: has joined #RubyOnRails
[11:03:04] dminuoso: Or rather *its props
[11:03:54] urk187: has joined #RubyOnRails
[11:04:06] dminuoso: The name "create-react-app" is slightly misleading. Think of React as just a view library. cra sets you up with more: it creates a small JS application that uses react to render a dom.
[11:04:16] dminuoso: And that "js application" can be extended in any way you want.
[11:04:46] dminuoso: Here maybe 2/3 of the JS code in our frontend/ is not React code.
[11:05:07] dminuoso: So it's just a "JavaScript frontend that uses React for managing the DOM"
[11:05:41] urk187: has joined #RubyOnRails
[11:06:38] urk187: has joined #RubyOnRails
[11:06:54] urk187: has joined #RubyOnRails
[11:07:23] dminuoso: quarters: This happens in a very non-obvious way.
[11:07:29] urk187: has joined #RubyOnRails
[11:08:24] urk187: has joined #RubyOnRails
[11:08:25] dminuoso: quarters: With some irrelevant code removed, this is actually the core of our frontend: https://gist.github.com/dminuoso/73c601edc8679ab8d37e0aa114e34c78
[11:08:31] quarters: dminuoso: in what instances would you take a different tack where you introduce state to the react tree and not use redux
[11:08:49] lupine: has joined #RubyOnRails
[11:09:36] urk187: has joined #RubyOnRails
[11:09:50] dminuoso: quarters: And configureStore boots up most of the non-react stuff.
[11:10:11] urk187: has joined #RubyOnRails
[11:11:06] urk187: has joined #RubyOnRails
[11:11:13] dminuoso: quarters: So our redux state is automatically persisted to localStorage (which means you never lose application state if you close a tab, not even the input form you just filled out)
[11:11:22] urk187: has joined #RubyOnRails
[11:11:26] dminuoso: quarters: So whenever we have the need that state must be persisted, it has to go into redux.
[11:12:08] dminuoso: Then there's the matter of how many components derive their props from the state
[11:12:17] urk187: has joined #RubyOnRails
[11:12:26] dminuoso: Also complexity (setting up redux to handle a dropdown toggled state is not worth the effort)
[11:12:43] dminuoso: Then there's the question whether a saga needs to somehow interact with that state or state changes
[11:12:52] urk187: has joined #RubyOnRails
[11:13:36] mikecmpbll: has joined #RubyOnRails
[11:13:50] urk187: has joined #RubyOnRails
[11:14:05] urk187: has joined #RubyOnRails
[11:14:40] urk187: has joined #RubyOnRails
[11:14:48] dminuoso: And like I mentioned: developer comfort. If you have some state you prefer to survive HMR -> it gets moved into redux. :-)
[11:15:00] urk187: has joined #RubyOnRails
[11:15:29] dminuoso: Although in all fairness there are tricks to have state inside react components survive a HMR
[11:15:35] urk187: has joined #RubyOnRails
[11:16:30] urk187: has joined #RubyOnRails
[11:17:25] urk187: has joined #RubyOnRails
[11:17:40] urk187: has joined #RubyOnRails
[11:18:20] quarters: I haven't worked with redux so I'm having trouble conceptualizing how state is persisted to local storage with redux. Is it saved to the browser like a cookie?
[11:18:35] urk187: has joined #RubyOnRails
[11:18:54] dminuoso: quarters: There's a middleware that basically keeps saving the redux state into localStorage whenever it changes (debounced to not ruin performance)
[11:19:10] urk187: has joined #RubyOnRails
[11:19:11] dminuoso: quarters: And yeah, kind of like a cookie.
[11:19:28] dminuoso: (The middleware allows for many other backends, like storing the redux state in cloud storage)
[11:19:30] urk187: has joined #RubyOnRails
[11:20:05] urk187: has joined #RubyOnRails
[11:20:23] quarters: is the middleware that does this part of redux?
[11:20:51] dminuoso: It is a redux middleware (and boy that word "middleware is such a terrible word"), but its not part of redux.
[11:21:01] urk187: has joined #RubyOnRails
[11:21:56] urk187: has joined #RubyOnRails
[11:21:58] dminuoso: quarters: If you come with angular you should be experienced with observables right?
[11:22:24] quarters: dminuoso: I haven't worked with observables at all
[11:22:29] dminuoso: You shoud. :-)
[11:22:41] apeiros_: has joined #RubyOnRails
[11:23:06] urk187: has joined #RubyOnRails
[11:23:38] quarters: I'll definitely look into them if this will help keep my react tree statefree and if I get all the attendant benefits of doing so
[11:23:41] urk187: has joined #RubyOnRails
[11:23:45] cschneid_: has joined #RubyOnRails
[11:24:33] dminuoso: quarters: Just be aware that React is heavily FP biased. Pure functions, immutable values, the entire nature of redux
[11:24:36] urk187: has joined #RubyOnRails
[11:24:41] dminuoso: The concept of react itself, just like observables is based on FRP.
[11:25:31] urk187: has joined #RubyOnRails
[11:26:41] urk187: has joined #RubyOnRails
[11:26:41] quarters: noted. I reckon that the concepts you just listed will come through use rather than me reading articles or textbooks regaring them
[11:27:18] urk187: has joined #RubyOnRails
[11:28:13] urk187: has joined #RubyOnRails
[11:30:02] urk187: has joined #RubyOnRails
[11:30:17] urk187: has joined #RubyOnRails
[11:31:12] urk187: has joined #RubyOnRails
[11:31:47] urk187: has joined #RubyOnRails
[11:32:42] urk187: has joined #RubyOnRails
[11:32:58] quarters: dminuoso: thanks for your help and advice. definitely quite a bit to chew on when moving forward with my project
[11:33:07] sajinmp: has joined #RubyOnRails
[11:33:37] urk187: has joined #RubyOnRails
[11:35:42] urk187: has joined #RubyOnRails
[11:36:17] urk187: has joined #RubyOnRails
[11:37:12] urk187: has joined #RubyOnRails
[11:38:07] urk187: has joined #RubyOnRails
[11:38:24] urk187: has joined #RubyOnRails
[11:38:33] fourcolors: has joined #RubyOnRails
[11:38:59] urk187: has joined #RubyOnRails
[11:39:42] jnollette: has joined #RubyOnRails
[11:39:53] urk187: has joined #RubyOnRails
[11:40:14] lunarkitty7: has joined #RubyOnRails
[11:40:31] sajinmp: has joined #RubyOnRails
[11:41:44] urk187: has joined #RubyOnRails
[11:41:59] urk187: has joined #RubyOnRails
[11:42:31] sajinmp: has left #RubyOnRails: ()
[11:42:54] urk187: has joined #RubyOnRails
[11:43:29] urk187: has joined #RubyOnRails
[11:44:26] urk187: has joined #RubyOnRails
[11:44:41] urk187: has joined #RubyOnRails
[11:45:36] urk187: has joined #RubyOnRails
[11:46:11] urk187: has joined #RubyOnRails
[11:47:06] urk187: has joined #RubyOnRails
[11:48:01] urk187: has joined #RubyOnRails
[11:48:19] urk187: has joined #RubyOnRails
[11:48:54] urk187: has joined #RubyOnRails
[11:50:41] urk187: has joined #RubyOnRails
[11:51:33] silvermine: has joined #RubyOnRails
[11:51:36] urk187: has joined #RubyOnRails
[11:52:31] urk187: has joined #RubyOnRails
[11:53:26] urk187: has joined #RubyOnRails
[11:54:14] mrbubbles: I'm trying to integrate Trestle with Devise. Trestle can call a function on login which authenticates a user but I can't find which one to call on the Devise model. I thought it would be something like User.authenticate(email, password) can anyone shed any light?
[11:55:14] urk187: has joined #RubyOnRails
[11:55:29] urk187: has joined #RubyOnRails
[11:56:24] urk187: has joined #RubyOnRails
[11:56:59] urk187: has joined #RubyOnRails
[11:57:54] urk187: has joined #RubyOnRails
[11:58:45] sunya7a_: ][''''''''''''
[11:58:49] urk187: has joined #RubyOnRails
[11:59:44] urk187: has joined #RubyOnRails
[11:59:58] urk187: has joined #RubyOnRails
[12:00:37] urk187: has joined #RubyOnRails
[12:01:31] urk187: has joined #RubyOnRails
[12:01:46] urk187: has joined #RubyOnRails
[12:03:19] urk187: has joined #RubyOnRails
[12:04:14] urk187: has joined #RubyOnRails
[12:04:29] urk187: has joined #RubyOnRails
[12:05:06] urk187: has joined #RubyOnRails
[12:06:01] urk187: has joined #RubyOnRails
[12:06:56] urk187: has joined #RubyOnRails
[12:07:11] urk187: has joined #RubyOnRails
[12:07:46] urk187: has joined #RubyOnRails
[12:08:41] urk187: has joined #RubyOnRails
[12:09:39] urk187: has joined #RubyOnRails
[12:09:54] urk187: has joined #RubyOnRails
[12:10:29] urk187: has joined #RubyOnRails
[12:10:31] apeiros: +b *!*@pool-98-113-93-25.nycmny.fios.verizon.net$#ruby-fix-your-connection
[12:10:41] apeiros: -o apeiros
[12:13:16] fourcolors: has joined #RubyOnRails
[12:19:51] gheegh: has joined #RubyOnRails
[12:24:40] apparition: has joined #RubyOnRails
[12:31:20] mixnblend: has joined #RubyOnRails
[12:37:52] fourcolors: has joined #RubyOnRails
[12:49:49] mikecmpbll: has joined #RubyOnRails
[12:53:46] dustinm`: has joined #RubyOnRails
[12:53:55] mtkd: has joined #RubyOnRails
[12:55:37] truenito: has joined #RubyOnRails
[13:06:25] elsurudo: has joined #RubyOnRails
[13:16:19] silvermine: has joined #RubyOnRails
[13:19:48] srinidhi: has joined #RubyOnRails
[13:22:57] Jameser: has joined #RubyOnRails
[13:29:50] mixnblend: has joined #RubyOnRails
[13:31:28] jnollette: has joined #RubyOnRails
[13:32:39] elsurudo: has joined #RubyOnRails
[13:33:33] elsurudo: Is anyone using Anvil/Pow server with High Sierra? Just upgraded, and I get an “Error starting application” error
[13:43:11] mixnblend: has joined #RubyOnRails
[13:44:55] simmerz: has joined #RubyOnRails
[13:46:27] memo1: has joined #RubyOnRails
[13:52:21] gregf_: has joined #RubyOnRails
[13:58:10] wardom: has joined #RubyOnRails
[13:58:15] JDeen: has joined #RubyOnRails
[14:00:15] wardom: I run rails server with 1 thread. If I run infinite loop inside request, other simple requests just wait forever.
[14:00:25] wardom: This smells like node.js's concurrency model
[14:00:31] wardom: any comment?
[14:00:56] wardom: is there any difference between ruby's and node.js's concurrency model?
[14:05:44] jottr: has joined #RubyOnRails
[14:13:31] apeiros: has joined #RubyOnRails
[14:18:15] quirkycoders: has joined #RubyOnRails
[14:18:37] Technodrome: has joined #RubyOnRails
[14:19:25] rfoust: has joined #RubyOnRails
[14:19:51] iamarun: has joined #RubyOnRails
[14:20:58] krawchyk: has joined #RubyOnRails
[14:23:38] srinidhi: has joined #RubyOnRails
[14:26:43] dviola: has joined #RubyOnRails
[14:29:02] elsurudo: ruby servers aren’t event-based like node, but yeah if you’re only running one thread and one server, an infinite loop will block subsequent requests
[14:29:23] elsurudo: there is usually a timeout set in rails though, so that request would be dropped after a time
[14:31:36] srinidhi: has joined #RubyOnRails
[14:34:22] silvermine: has left #RubyOnRails: ("WeeChat 2.0-dev")
[14:34:46] silvermine: has joined #RubyOnRails
[14:37:33] havenwood: wardom: Ruby webservers offer a combination of process forking, threading and evented io. Some use all three.
[14:38:55] wardom: havenwood: I'm deciding which is better regarding to doing CPU-intensive stuff. Ruby or Node?
[14:39:13] wardom: I know Node simply blocks for such things
[14:40:19] havenwood: wardom: You might consider JRuby.
[14:42:33] Barrt: has joined #RubyOnRails
[14:43:09] wardom: When I set max threads for Puma rails erver to 5, does that means actually 5 requests can be served at once, or can there be more, because when waiting while doing IO operations other stuff can be executed?
[14:48:36] havenwood: wardom: It means the thread pool will have 5 threads waiting to handle requests.
[14:50:37] memo1: I have a Rails app, deploy in 2 heroku instances, one for production and one for staging. The productions is working nicely, but staging (despite being configured right with staging variables) keeps taking settings of the production app. For example, the Action Cable setting of staging needs to set ws:staging.... but is getting ws:production...
[14:53:29] havenwood: wardom: On CRuby if one thread is doing computation it'll typically block the other threads from doing computation at that same time. On JRuby threads can be doing computation at the same time on different cores.
[14:53:54] havenwood: memo1: Is your RAILS_ENV set to "production" on staging?
[14:55:24] MrCrackPotBuilde: has joined #RubyOnRails
[14:56:26] KeyJoo: has joined #RubyOnRails
[15:01:33] sunya7a: has joined #RubyOnRails
[15:02:52] SteenJobs: has joined #RubyOnRails
[15:06:08] mauro1254: has joined #RubyOnRails
[15:11:33] mauro1254: Hi folks, I have a question about session / flash. I have a dozen of Rails 5.1.4 applications running on subdomains (in order to easily have SSO). I would like to have some data accessibile by all applications (eg. authenticated user id) and other date accessible only by the application that stored it. Is it possible?
[15:14:46] Saukk: has joined #RubyOnRails
[15:17:21] mr-spoon: has joined #RubyOnRails
[15:23:21] silvermine: has joined #RubyOnRails
[15:24:30] cschneid_: has joined #RubyOnRails
[15:36:50] dminuoso: mauro1254: Yes, use the client.
[15:37:18] dminuoso: mauro1254: OAuth2 offers a relatively seamless approach to get SSO semantics.
[15:38:40] gheegh: has joined #RubyOnRails
[15:40:11] mauro1254: dminuoso : thx
[15:41:02] dminuoso: mauro1254: though I'd be careful to share data between those applications.
[15:41:13] dminuoso: If it's just the user id, OAuth has you covered.
[15:41:33] mauro1254: dminuoso : yes, it is just the user id
[15:41:48] mauro1254: I would like an app to act as oauth provider
[15:43:03] dminuoso: Yup, and each of your websites is a registered application. Since the user maintains a session cookie with the OAuth2 server, any grant type will just cause at most 2 redirects.
[15:43:31] dminuoso: So if you are already logged in, and you suddenly visit another of those websites, it will just redirect you twice, and you're logged in. (Assuming you are using the access grant)
[15:43:48] mixnblend: has joined #RubyOnRails
[15:44:29] dminuoso: (For this use case we can ignore the explicit authorization grant)
[15:45:47] mauro1254: dminuoso : I tried to implement this solution a few months ago but I had problems with logout
[15:46:19] dminuoso: mauro1254: Heh. Were you using a rails based OAuth2 server? Perhaps with doorkeeper?
[15:47:52] quirkycoders: has joined #RubyOnRails
[15:48:33] drowze: has joined #RubyOnRails
[15:50:00] mr-spoon: has joined #RubyOnRails
[15:50:07] mauro1254: dminuoso : Yes, I followed a serie of tutorials on binarywebpark.com
[15:50:27] mauro1254: btw, am I allowed to post links?
[15:50:47] mauro1254: http://www.binarywebpark.com/oauth-2-tutorial/
[15:51:00] mauro1254: http://www.binarywebpark.com/setting-oauth-provider-ruby-rails-doorkeeper-devise/
[15:51:10] dminuoso: mauro1254: We learned some interesting lessons wrt "logging out". It's easily doable, but there's 2 things to consider.
[15:51:22] mauro1254: http://www.binarywebpark.com/oauth-client-application-testing-rails/
[15:57:25] mauro1254: dminuoso : which things?
[15:58:49] dminuoso: mauro1254: We thought DELETE /whatever/sessions (check your rails routes for the exact path) with CORS properly configured would be enough.
[15:59:02] dminuoso: But one of the devs noticed that when visiting the OAuth server, he was instantly logged back in..
[15:59:31] mtkd: has joined #RubyOnRails
[15:59:46] dminuoso: So we realized that its a nasty side effect of using the cookie session store.
[16:00:06] DoubleMalt: has joined #RubyOnRails
[16:03:52] mauro1254: dminuoso : I'm using ActiveRecord session store
[16:14:17] Saukk: has joined #RubyOnRails
[16:16:35] Saukk: has joined #RubyOnRails
[16:21:28] mr-spoon: has joined #RubyOnRails
[16:23:13] NoGodDamnIdea: has joined #RubyOnRails
[16:27:40] MrCrackPotBuilde: has joined #RubyOnRails
[16:28:19] troys: has joined #RubyOnRails
[16:31:12] apeiros: has joined #RubyOnRails
[16:37:11] uks: has joined #RubyOnRails
[16:39:35] mcr1: has joined #RubyOnRails
[16:43:15] SteenJobs: has joined #RubyOnRails
[16:46:56] senaa: has joined #RubyOnRails
[16:50:33] senaa: has joined #RubyOnRails
[16:52:08] [Butch]: has joined #RubyOnRails
[16:54:54] Dimik: has joined #RubyOnRails
[16:57:45] DoubleMalt: has joined #RubyOnRails
[17:00:25] memo1: has joined #RubyOnRails
[17:01:55] mcr1: has joined #RubyOnRails
[17:07:19] senaa: has left #RubyOnRails: ("Leaving")
[17:10:00] quirkycoders: has joined #RubyOnRails
[17:11:27] one_zero: has joined #RubyOnRails
[17:16:07] mr-spoon: has joined #RubyOnRails
[17:18:32] dblessing: has joined #RubyOnRails
[17:24:34] apeiros: has joined #RubyOnRails
[17:31:06] mr-spoon: has joined #RubyOnRails
[17:31:11] mcr1: has joined #RubyOnRails
[17:32:19] SteenJobs: has joined #RubyOnRails
[17:41:25] orbyt_: has joined #RubyOnRails
[17:48:04] memo1: havenwood: is set to staging
[17:48:26] duderonomy: has joined #RubyOnRails
[17:48:33] memo1: havenwood: but it keeps "listening" to production
[17:49:57] duderonomy: has joined #RubyOnRails
[18:10:15] silvermine: has joined #RubyOnRails
[18:10:23] kies: has joined #RubyOnRails
[18:24:18] ur5us: has joined #RubyOnRails
[18:36:47] mr-spoon: has joined #RubyOnRails
[18:45:00] JusticeFries: has joined #RubyOnRails
[18:45:20] JusticeFries: has left #RubyOnRails: ()
[18:45:51] centrx: has joined #RubyOnRails
[18:46:26] quazimodo: has joined #RubyOnRails
[18:49:51] brycesenz: has joined #RubyOnRails
[18:55:36] quirkycoders: has joined #RubyOnRails
[19:03:20] conta: has joined #RubyOnRails
[19:09:11] mcr1: has joined #RubyOnRails
[19:11:19] blindMoe: has joined #RubyOnRails
[19:12:16] blindMoe: Anyone with JSONAPI Resource experience know if it possible to specify a has_one :through relationship in the resource and be able to filter / sort by it? Right now it seems like jsonapi resource is not respecting the :through declaration
[19:12:29] blindMoe: the same relation is set in the actual model and works just fine
[19:13:02] duderonomy: has joined #RubyOnRails
[19:19:13] patrick99e99: has joined #RubyOnRails
[19:20:30] memo1: has joined #RubyOnRails
[19:21:30] patrick99e99: hey everyone... quick question.. So I deploy to two servers, both do a rake assets:precompile, public/packs/vendor.js have different md5 shas, even though diffing the two files are identical.. Is there any reason anyone can think of why these fingerprints would end up being different? it's very baffling, and causing problems due to loadbalancer rerouting a request for a particular fingerprint that does not exist on th
[19:53:24] noob_on_rails: has joined #RubyOnRails
[19:54:26] noob_on_rails: hey all , if i have a through table which connects a user and an album , which album belongs_to a category
[19:54:45] noob_on_rails: what would be a way to know how many albums of each category the user has
[19:56:48] alexertech: has joined #RubyOnRails
[19:58:36] fryguy: noob_on_rails: category.albums.count
[19:58:39] dminuoso: patrick99e99: I can.
[19:59:40] noob_on_rails: i miss something here :D
[20:00:23] krawchyk: has joined #RubyOnRails
[20:00:41] noob_on_rails: category meaning , User.first.albums.map { |a| Category.find_by_id(a.category_id)} ?
[20:01:43] noob_on_rails: i think i ll haave to use a hash and increment the value by the key
[20:02:09] noob_on_rails: i was wondering if theres something better / more convenient
[20:09:44] fryguy: noob_on_rails: User.first.albums.map {|a| a.category.id}
[20:23:51] mostlybadfly: has joined #RubyOnRails
[20:24:03] alexertech: has joined #RubyOnRails
[20:26:26] daveomcd: has joined #RubyOnRails
[20:27:20] daveomcd: I'm trying to track down this routing error that keeps showing up in my terminal when running the server on my development machine. https://gist.github.com/daveomcd/cdffadeedb1bffdfad848d2a8271707b -- can anyone suggest how i can track it down? I've done a grep in my project and nothing... im to the point where I'm gussing it has to be due to a gem?
[20:32:10] dminuoso: daveomcd: Are you trying to use actioncable, or are you wondering why you get the error?
[20:35:45] daveomcd: dminuoso, on this branch im not trying to use actioncable. It's still rails 4.2 - but I did at one time try to use a websockets gem; however, I've stripped that completely from the application from what i can tell
[20:36:01] daveomcd: and so im trying to find out why I'm still seeing this error when running my server on development
[20:36:38] dminuoso: daveomcd: Check your JavaScript assets.
[20:39:05] daveomcd: dminuoso, yea i've checked there and nothing is there that I would think would contribute to this issue - or that was placed there from when I was "installing" the websockets gem
[20:39:21] dminuoso: daveomcd: Have you perhaps precompiled assets lying around?
[20:39:40] daveomcd: dminuoso, how would i tell that? or reset them?
[20:39:49] dminuoso: daveomcd: Are you on a production machine?
[20:40:24] daveomcd: dminuoso, nope on my development machine
[20:40:27] dminuoso: daveomcd: `rake assets:clobber` then.
[20:41:36] daveomcd: ok i executed it, but still getting the error after restarted the server
[20:42:35] dminuoso: daveomcd: When does this routing error happen?
[20:44:05] daveomcd: dminuoso, happens like every 25 seconds in the terminal window, even when I'm not navigating to different pages on the app
[20:44:16] dminuoso: daveomcd: Close your entire browser.
[20:44:18] dminuoso: See if the problem persists.
[20:44:31] daveomcd: ok one second let me try
[20:45:06] quazimodo: has joined #RubyOnRails
[20:46:00] daveomcd: dminuoso, thanks looks like that corrected it
[20:46:18] dminuoso: daveomcd: Problem solved.
[20:46:19] helpa: Next question, please!
[20:46:27] daveomcd: dminuoso, really appreciate the help I wasn't sure what was going on :)
[20:47:11] dminuoso: daveomcd: Might have been some spurious service worker perhaps from some gem
[20:54:21] yehowyada: has joined #RubyOnRails
[20:58:21] orbyt_: has joined #RubyOnRails
[21:01:05] quirkycoders: has joined #RubyOnRails
[21:24:15] cnk: has joined #RubyOnRails
[21:25:01] cnk: has joined #RubyOnRails
[21:36:01] eljimmy: has joined #RubyOnRails
[21:36:54] krawchyk: has joined #RubyOnRails
[21:37:19] DoubleMalt: has joined #RubyOnRails
[21:40:03] eljimmy: i've got Class A with has_many to Class B which has has_one to Class A and a has_many of Class C. is it possible to pass a param to class B so that it knows which record of class A loaded it? i want to use it to specify which records of Class C to load. not sure if thats possible, bit of a mess.
[21:40:57] cnk: So you want to restrict the possible list of C's based on what B has mapped as A?
[21:41:30] cnk: (by the way, it is ALWAYS easier to help if you do NOT obfiscate the domain, real names, not ABC)
[21:43:11] eljimmy: i _think_ that sounds right, yeah - so i have a Question, which has many Answer, and sometimes an Answer will have many ConditionalAnswer, but because an Answer can be used for multiple questions, i only want to load ConditionalAnswer based upon the record of the Question and the Answer.
[21:44:39] eljimmy: originally was just loading them in a method in the Question model but thought it might be possible to do this via relationship scopes
[21:44:39] cnk: Hmmm it sounds to me like Answer and ConditionalAnswer should be directly related - not just via Questoin. Is that true?
[21:45:22] cnk: What didn't you like about the original solution? It sounds OK to me
[21:45:41] eljimmy: yeah problem is Answer is used for multiple Questions and not every Question is going to have that answer with the same conditionals
[21:45:58] eljimmy: oh i dunno, i just thought it might be possible with scopes but starting to think it may not be
[21:46:40] arpu: has joined #RubyOnRails
[21:47:17] patrick99e99: dminuoso: yes? what do you think is causing different fingerprints ?
[21:48:02] macxim: has joined #RubyOnRails
[21:49:24] cnk: Scopes are really just a shorthand for a query so your explicit query method in Question is equivalent and straightforward
[21:50:28] dminuoso: patrick99e99: Let me do some research to be sure before I answer that question.
[21:50:51] quirkycoders: has joined #RubyOnRails
[21:51:00] eljimmy: cnk, fair enough, well that makes me feel ok about it then, i'll stick with that! thanks!
[21:59:47] simmerz: has joined #RubyOnRails
[22:01:23] orbyt_: has joined #RubyOnRails
[22:03:11] SteenJobs: has joined #RubyOnRails
[22:05:08] dminuoso: patrick99e99: Diving into sprockets in case you are wondering why this is taking a bit.
[22:08:04] patrick99e99: dminuoso: are you sure the sprockets is the one making this fingerprint and not webpacker?
[22:08:15] patrick99e99: dminuoso: this is a finger print in public/packs/
[22:09:44] dminuoso: patrick99e99: Of course I do. It would be silly for me to dig into sprockets when there's something wrong with webpacker.
[22:10:26] patrick99e99: I have no idea.
[22:10:52] silvermine: has joined #RubyOnRails
[22:11:22] macxim: has joined #RubyOnRails
[22:11:43] dminuoso: patrick99e99: https://github.com/rails/webpacker/blob/master/lib/webpacker/compiler.rb#L45
[22:11:52] dminuoso: Does that answer your question sufficiently?
[22:14:19] patrick99e99: dminuoso: so this digest has absolutely nothing to do with the contents of the file? but rather the file's name and timestamp! ?
[22:14:27] dminuoso: patrick99e99: It seems so.
[22:14:38] dminuoso: patrick99e99: You can probably quickly confirm this.
[22:14:50] dminuoso: precompile assets, touch the file, precompile again see if the hash chagnes
[22:16:26] rfoust: has joined #RubyOnRails
[22:18:46] Technodrome: has joined #RubyOnRails
[22:20:08] memo1: has joined #RubyOnRails
[22:20:41] patrick99e99: dminuoso: well touching the file (vendor.js) does nothing, it acts like the compilation is cached, it does not say "compiling" unless i do an rake assets:clobber first
[22:21:04] memo1: hi. Im new to backend development. Im learing Rails. Can you recommend a great frontend framework that integrate well with rails?
[22:21:06] dminuoso: patrick99e99: based on the code that suggests it wouldnt change
[22:21:39] dminuoso: memo1: Any really. Rails brings its own static page generation, but we have webpacker integration with a pretty great react-rails plugin
[22:22:02] dminuoso: Or you just work with it separately and roll your own JS based fronend with whatever JS tech you are comfortable withl
[22:25:14] dminuoso: patrick99e99: do you have any funky webpack loaders or things?
[22:28:57] patrick99e99: dminuoso: .................... ummm?????? i dont think so? what would be a funky loader or thing?
[22:36:26] patrick99e99: dminuoso: and yeah that digest stuff in the code isn't the problem..
[22:46:13] howlcode: has joined #RubyOnRails
[22:46:25] Cache_Money: has joined #RubyOnRails
[22:47:03] Puffball: has joined #RubyOnRails
[22:48:43] arBmind: has joined #RubyOnRails
[22:52:34] nicholasthegr8t: has joined #RubyOnRails
[22:59:28] kapil___: has joined #RubyOnRails
[23:13:14] mr-spoon: has joined #RubyOnRails
[23:27:53] mostlybadfly: has joined #RubyOnRails
[23:30:14] orbyt_: has joined #RubyOnRails
[23:33:45] Technodrome: has joined #RubyOnRails
[23:35:46] dviola: has joined #RubyOnRails
[23:40:20] Exhiled: has joined #RubyOnRails
[23:40:25] Puffball: has joined #RubyOnRails
[23:50:58] Exhiled: has joined #RubyOnRails
[23:59:01] Exhiled: has joined #RubyOnRails