« Back to channel list

#RubyOnRails - 02 August 2018

« Back 1 day Forward 1 day »
[00:00:06] eckhardt: has joined #RubyOnRails
[00:04:57] w0rd-driven: has joined #RubyOnRails
[00:25:47] trinaldi: has joined #RubyOnRails
[00:27:49] quazimodo: has joined #RubyOnRails
[00:30:42] havenwood: quazimodo: hi
[00:41:00] quazimodo: i'v always used shared test groups fro things like 'backend' controller user auth
[00:41:51] quazimodo: but... it's a loooot of tests sometimes for complex behaviour... I'm thinking maybe it's better to pull that functionality nito a module, test that module on an anonymous class & then verify my backend controllers have the functionality by testing their 'shape' once (as in, whether they have the module included'
[00:42:45] quazimodo: it's not the way i'd usually test thnigs but jeeper's that's a lot of test the suite doesn't need anymore
[00:43:01] cagomez: has joined #RubyOnRails
[00:43:44] quazimodo: any thoughts
[00:49:50] Technodrome: has joined #RubyOnRails
[00:59:04] sevenseacat: has joined #RubyOnRails
[01:15:50] GodFather: has joined #RubyOnRails
[01:25:48] Caerus: quazimodo, very related, can wholeheartedly recommend you watch this talk: https://www.youtube.com/watch?v=TkbkCzwg6b8 deserves more upvotes. It hit it home for me and it might help you get an idea of how to test ´less´
[01:27:54] ur5us: has joined #RubyOnRails
[01:29:07] sevenseacat: ooh I like being recommended new talks
[01:31:27] Caerus: I watch those talks mostly cuz I plan on someday getting a job doing rails. I´m on a legacy proyect and his ´quadrant´ train of thought has helped me so much.
[01:32:47] sevenseacat: I know I have somewhat strong opinions on what should be tested and what shouldnt be - but I also have the nagging feeling its not quite 'right' sometimes
[01:33:02] cagomez: has joined #RubyOnRails
[01:35:11] ur5us: has joined #RubyOnRails
[01:36:14] Guest83186: has joined #RubyOnRails
[01:39:13] lexileo: has joined #RubyOnRails
[01:39:49] sevenseacat: this does sound like a reimagining of a sandi metz talk I watched ages ago
[01:44:35] Caerus: Oh didn´t know about the talk, I just found it :o I did look up the rules tho.
[01:45:35] prettybTech: has joined #RubyOnRails
[02:06:36] Saukk: has joined #RubyOnRails
[02:11:35] prettybTech: has joined #RubyOnRails
[02:24:45] sevenseacat: interesting, I have a strong parameters call barfing because its expecting a hash of stuff to whitelist, and getting a string instead - surely that should return a 400 instead of a 500
[02:25:35] sevenseacat: params.require(:contestant).permit(:name, :email) is giving a NoMethodError if params[:contestant] is just a string
[02:31:16] quazimodo: Caerus: cheers, i'll watch. The thorough answer is test groups & thorough tests with minimum actual test code... but jees it can take forever
[02:41:20] sevenseacat: this seems like I could really easily make any page throw a 500 if I pass in a string instead of a hash, as just about every page will expect a hash of data
[02:49:33] alfiemax: has joined #RubyOnRails
[02:54:59] sevenseacat: https://github.com/rails/rails/issues/30519 this, pretty much
[02:56:14] sevenseacat: seems to be a big flaw in the design of strong parameters
[02:56:25] prettybT_: has joined #RubyOnRails
[02:57:55] Saukk: has joined #RubyOnRails
[02:59:02] kapil___: has joined #RubyOnRails
[03:08:15] Technodrome: has joined #RubyOnRails
[03:09:42] braincrash: has joined #RubyOnRails
[03:11:09] markh: has joined #RubyOnRails
[03:13:26] ebsen: has joined #RubyOnRails
[03:23:48] sirensari2: has joined #RubyOnRails
[03:35:52] orbyt_: has joined #RubyOnRails
[03:36:51] Guest83186: has joined #RubyOnRails
[04:19:36] fragamus: has joined #RubyOnRails
[04:20:28] srinidhi: has joined #RubyOnRails
[04:25:59] srinidhi: has joined #RubyOnRails
[04:32:26] alfiemax: has joined #RubyOnRails
[04:35:39] Guest83186: has joined #RubyOnRails
[04:37:26] Puffball: has joined #RubyOnRails
[04:57:15] srinidhi: has joined #RubyOnRails
[05:01:43] duderonomy: has joined #RubyOnRails
[05:26:25] srinidhi: has joined #RubyOnRails
[05:43:44] cagomez: has joined #RubyOnRails
[06:16:33] snickers: has joined #RubyOnRails
[06:30:36] psychoslave_: has joined #RubyOnRails
[06:31:34] fragamus: has joined #RubyOnRails
[06:42:25] viatsko: has joined #RubyOnRails
[06:45:33] viatsko_: has joined #RubyOnRails
[07:16:45] mtkd: has joined #RubyOnRails
[07:18:39] conta: has joined #RubyOnRails
[07:26:14] dionysus69: has joined #RubyOnRails
[07:36:55] Liothen: has joined #RubyOnRails
[07:44:22] za1b1tsu: has joined #RubyOnRails
[07:48:31] za1b1tsu: has joined #RubyOnRails
[07:48:32] havenwood: has joined #RubyOnRails
[07:48:32] Psy-Q: has joined #RubyOnRails
[07:52:16] Alchemical: has joined #RubyOnRails
[08:16:06] alfiemax: has joined #RubyOnRails
[08:20:46] georgie: has joined #RubyOnRails
[08:28:27] alfiemax: has joined #RubyOnRails
[08:28:32] Dbugger: has joined #RubyOnRails
[08:40:01] quazimodo: has joined #RubyOnRails
[08:44:06] Andr3as: morning all.. i am aware of the possibility to "override" ActionView::Base.field_error_proc to get a more bootstrap like class settings...
[08:44:24] Guest83186: has joined #RubyOnRails
[08:44:30] Andr3as: is there something to set the class for fields without error?
[08:45:10] reber: has joined #RubyOnRails
[08:45:13] Andr3as: after a validation brought up some other fields with an error, obviously
[08:49:20] apeiros: has joined #RubyOnRails
[08:55:06] srinidhi: has joined #RubyOnRails
[09:12:49] hightower4: has joined #RubyOnRails
[09:48:02] syndikate: Andr3as, can you elaborate please?
[09:48:59] Andr3as: syndikate: if you have a validation and it fails it wraps the field with the error in a div with a class "field_with_error" when it renders the view again
[09:49:22] Andr3as: you can change that behavier when you change ActionView::Base.field_error_proc
[09:50:37] Andr3as: i did it and it works as expected
[09:51:03] Andr3as: what i would like to have though is that it wraps fields without an error as well.. with a different class though
[09:51:21] Andr3as: to kinda show correct fields in green and fields with error in red
[09:53:13] cheeti: has joined #RubyOnRails
[09:53:28] syndikate: Or you could add a class to the field if the returned object has no error for it?
[09:53:53] syndikate: Which I believe could be a repetitive task
[09:54:01] cheeti: hi i am usinf pdfkit to generate pdf from html, is this possible to print text outside of left margin?
[10:02:33] Ergo: has joined #RubyOnRails
[10:11:03] alfiemax: has joined #RubyOnRails
[10:11:59] mikecmpbll: has joined #RubyOnRails
[10:24:04] ciro: has joined #RubyOnRails
[10:30:19] alfiemax: has joined #RubyOnRails
[10:31:22] Sylario: has joined #RubyOnRails
[10:37:10] hahuang65: has joined #RubyOnRails
[10:41:52] dionysus69: has joined #RubyOnRails
[10:43:55] alfiemax: has joined #RubyOnRails
[10:45:37] Andr3as: syndikate: yeah, maybe thats what i have to do.. i just thought if there's a "field_with_error" there may be a way for a field without error too
[10:45:42] Andr3as: from within rails
[10:50:18] cschneid_: has joined #RubyOnRails
[11:07:56] Zinder: has joined #RubyOnRails
[11:07:57] Sylario: has joined #RubyOnRails
[11:21:55] mikecmpbll: has joined #RubyOnRails
[11:30:06] ciro: has joined #RubyOnRails
[11:31:41] nzst: has joined #RubyOnRails
[11:44:04] borodin: has joined #RubyOnRails
[11:55:06] fmcgeough: has joined #RubyOnRails
[12:02:38] IanMalcolm: has joined #RubyOnRails
[12:03:28] conta: has joined #RubyOnRails
[12:03:35] za1b1tsu: has joined #RubyOnRails
[12:12:22] augcesar: has joined #RubyOnRails
[12:12:23] rikkipitt: has joined #RubyOnRails
[12:23:14] srinidhi: has joined #RubyOnRails
[12:28:42] GodFather: has joined #RubyOnRails
[12:44:15] cagomez: has joined #RubyOnRails
[12:56:42] fmcgeough: has joined #RubyOnRails
[13:01:49] apeiros__: has joined #RubyOnRails
[13:25:15] Technodrome: has joined #RubyOnRails
[13:31:18] mikecmpbll: has joined #RubyOnRails
[13:39:15] Technodrome: has joined #RubyOnRails
[13:52:36] _Caerus: has joined #RubyOnRails
[14:07:34] cjohnson: havenwood: Yeah, anything but nil. But I remembered about `exclusion`
[14:13:41] IanMalcolm: has joined #RubyOnRails
[14:14:11] alfiemax: has joined #RubyOnRails
[14:25:20] IanMalcolm: has joined #RubyOnRails
[14:49:23] DaniG2k: has joined #RubyOnRails
[14:50:14] DaniG2k: hello all. I'm having a hard time doing an ActiveRecord `group()` on a related model. My query is as follows:
[14:50:56] DaniG2k: organization.containers.currently_at('Terminal').joins(:container_type).group('container_types.label')
[14:51:03] DaniG2k: but I get the error message:
[14:51:16] DaniG2k: PG::GroupingError: ERROR: column "containers.id" must appear in the GROUP BY clause or be used in an aggregate function
[14:57:49] ivanskie: has joined #RubyOnRails
[14:59:49] srinidhi: has joined #RubyOnRails
[15:00:18] nzst: did you try what the error suggested?
[15:04:41] DaniG2k: yeah I added `.select('count(containers.id) as total')` but that also failed
[15:06:25] DaniG2k: I'll try with a double group
[15:06:29] DaniG2k: .group('containers.id, container_types.label')
[15:07:02] ivanskie: has joined #RubyOnRails
[15:10:11] conta: has joined #RubyOnRails
[15:20:07] ivanskie: has joined #RubyOnRails
[15:27:32] ivanskie: has joined #RubyOnRails
[15:28:42] tcopeland: has joined #RubyOnRails
[15:33:34] Technodrome: has joined #RubyOnRails
[15:48:55] ivanskie: has joined #RubyOnRails
[15:48:58] srinidhi: has joined #RubyOnRails
[15:54:22] dviola: has joined #RubyOnRails
[15:56:53] lunarkitty7: has joined #RubyOnRails
[16:03:40] cagomez: has joined #RubyOnRails
[16:04:04] cagomez: has joined #RubyOnRails
[16:15:29] markh: has joined #RubyOnRails
[16:20:30] IanMalcolm: has joined #RubyOnRails
[16:21:34] mholmes: has joined #RubyOnRails
[16:26:22] nottwo_: has joined #RubyOnRails
[16:26:42] [Butch]: has joined #RubyOnRails
[16:30:39] eckhardt: has joined #RubyOnRails
[16:37:54] conta: has joined #RubyOnRails
[16:40:24] dionysus69: has joined #RubyOnRails
[16:43:34] chouhoulis: has joined #RubyOnRails
[16:43:57] sidntrivedi012: has joined #RubyOnRails
[16:45:03] Cache_Money: has joined #RubyOnRails
[16:47:53] orbyt_: has joined #RubyOnRails
[16:50:13] prettybTech: has joined #RubyOnRails
[16:50:46] krawchyk: has joined #RubyOnRails
[16:51:00] Technodrome: has joined #RubyOnRails
[17:01:55] emptyflask: has joined #RubyOnRails
[17:06:39] emptyflask: has anyone had luck with running webpack-dev-server automatically in dev mode? I run my apps via nginx/passenger, so thought about using passenger to run it directly as a node app, but that would require bypassing webpacker
[17:29:42] ivanskie: has joined #RubyOnRails
[17:30:16] lomex: has joined #RubyOnRails
[17:36:35] conta: has joined #RubyOnRails
[17:45:03] samosaphile: has joined #RubyOnRails
[17:54:07] alfiemax: has joined #RubyOnRails
[18:08:03] IanMalcolm: has joined #RubyOnRails
[18:20:06] apeiros: has joined #RubyOnRails
[18:28:15] cjohnson: emptyflask: webpacker will automatically start webpack in dev mode, and then use your rails app to proxy requests into it
[18:28:53] cjohnson: The only thing it won't handle is the websocket connection for live reload, so you would need tp expose the websocket port of the webpack-dev-server to your machine
[18:29:02] cjohnson: But we successfully use it behind a proxy no problem
[18:32:24] cjohnson: Question in rails 4, using accepts_nested_attributes_for, when I'm creating a new parent record + new child records, the child records fail validation because the parent_id is not set
[18:32:48] cjohnson: It seems to me that accepts_nested_attributes_for ought to be passing this down magically but maybe I'm using it wrong. Can I just not use that for new records?
[18:34:56] prettybTech: has joined #RubyOnRails
[18:38:12] orbyt_: has joined #RubyOnRails
[18:39:06] [Butch]: has joined #RubyOnRails
[18:42:56] monkeydev80: has joined #RubyOnRails
[19:00:07] sameerynho: has joined #RubyOnRails
[19:07:33] IanMalcolm: has joined #RubyOnRails
[19:24:13] dionysus69: has joined #RubyOnRails
[19:30:47] trinaldi: has joined #RubyOnRails
[19:36:09] trinaldi: has joined #RubyOnRails
[19:38:12] trinaldi: has joined #RubyOnRails
[19:39:24] orbyt_: has joined #RubyOnRails
[19:41:30] trinaldi: has joined #RubyOnRails
[19:42:29] mondz: has joined #RubyOnRails
[19:43:10] Dbugger: has joined #RubyOnRails
[19:45:55] giraffe: has joined #RubyOnRails
[20:04:24] prettybTech: has joined #RubyOnRails
[20:05:06] chouhoulis: has joined #RubyOnRails
[20:07:04] lomex: has joined #RubyOnRails
[20:21:58] DTZUZO: has joined #RubyOnRails
[20:25:58] Inside: has joined #RubyOnRails
[20:27:42] Inside: I've had this problem for a few weeks now
[20:27:59] Inside: something happened where centos running in virtual box running on windows doesn't detect changes in a shared folder
[20:28:20] emptyflask: cjohnson: really? I know that webpacker will rebuild as needed, but to have auto-refreshing and rebuilds whenever a file changes, it seems to require bin/webpack-dev-server
[20:30:20] Inside: https://github.com/rails/rails/issues/16678
[20:30:48] Inside: if there's a disparity between VM guest/host clocks rails' reloader won't work
[20:32:41] orbyt_: has joined #RubyOnRails
[20:32:41] emptyflask: Inside: ahh, that does make a lot of sense
[20:36:24] emptyflask: Inside: do you have the virtualbox guest additions installed?
[20:38:09] Inside: Yeah I do
[20:38:17] Inside: but apparently it allows up to 20 minutes of skew
[20:38:27] Inside: "What VirtualBox does every 10 seconds is just slight adjustement (something like 0.005 seconds). Only when the time difference reaches a threshold (20 minutes by default) a "real" resync is done.
[20:40:25] emptyflask: I guess you could just use ntp with an external source then
[20:40:30] Inside: It says not to do that D:
[20:40:34] Inside: $ sudo /usr/sbin/VBoxService --timesync-set-start
[20:40:44] Inside: time to write a script haha
[20:45:04] weaksauce: has joined #RubyOnRails
[20:46:01] emptyflask: people seem to have luck with timesync-set-threshold=10000 (10 seconds)
[20:51:41] cjohnson: emptyflask: Hrm, maybe you're right after all
[20:51:47] ivanskie: has joined #RubyOnRails
[20:52:00] cjohnson: Looks like webpacker, with the right config, will proxy to your dev server, but we are running it manually on our setup
[20:53:37] King_Rex: has joined #RubyOnRails
[20:56:30] cjohnson: I could have sworn I was reading code that started it though. I'm not entirely convinced there isn't some code that does it
[20:56:38] cjohnson: I would read through the webpacker code it's honestly pretty straight forward
[20:56:49] cjohnson: I recently submitted a patch to it to fix some broken behavior
[20:58:19] GodFather: has joined #RubyOnRails
[20:59:23] Inside: whooo the clock is drifting like crazy
[20:59:43] Inside: like 30 seconds per 10 minutes
[21:02:09] prettybTech: has joined #RubyOnRails
[21:02:21] MrCrackPotBuilde: has joined #RubyOnRails
[21:04:33] eddof13: has joined #RubyOnRails
[21:04:54] beowuff: has joined #RubyOnRails
[21:23:46] prettybTech: has joined #RubyOnRails
[21:23:53] weaksauce: has joined #RubyOnRails
[21:27:11] akaiiro: has joined #RubyOnRails
[21:30:02] tycoon177: what templating engines out there are worth looking into? erb is really starting to grind my gears. i'm going to be looking into haml. it's the one i see most often, next to erb. Are there any others worth looking into?
[21:36:39] fmcgeough: has joined #RubyOnRails
[21:40:58] sonOfRa: has joined #RubyOnRails
[21:42:19] beowuff: has joined #RubyOnRails
[21:43:01] eckhardt: has joined #RubyOnRails
[21:45:12] ur5us: has joined #RubyOnRails
[21:47:49] dviola: has joined #RubyOnRails
[21:55:10] psychoslave_: has joined #RubyOnRails
[21:57:37] akaiiro: tycoon177 slim
[22:03:51] prettybTech: has joined #RubyOnRails
[22:12:00] apeiros: has joined #RubyOnRails
[22:17:57] tycoon177: I'll check it out, thanks
[22:18:06] prettybTech: has joined #RubyOnRails
[22:24:06] ellcs: has joined #RubyOnRails
[22:25:12] eckhardt: has joined #RubyOnRails
[22:39:36] moei: has joined #RubyOnRails
[22:59:39] apeiros: has joined #RubyOnRails
[23:15:15] apeiros: has joined #RubyOnRails
[23:16:30] orbyt_: has joined #RubyOnRails
[23:30:47] sirensari2: has joined #RubyOnRails
[23:34:23] Technodrome: has joined #RubyOnRails
[23:37:23] beowuff: has joined #RubyOnRails
[23:44:36] frewsxcv: has joined #RubyOnRails
[23:44:50] frewsxcv: does anyone know a library that tracks how often a template gets rendered?
[23:45:04] frewsxcv: if one wanted to find all the unused templates in a codebase
[23:52:59] IanMalcolm: has joined #RubyOnRails