#RubyOnRails - 02 August 2018
« Back 1 day Forward 1 day »
[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
[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: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
[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
[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...
[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: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:53:28] syndikate: Or you could add a class to the field if the returned object has no error for it?
[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: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
[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:16] DaniG2k: PG::GroupingError: ERROR: column "containers.id" must appear in the GROUP BY clause or be used in an aggregate function
[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
[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: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?
[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: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: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: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
[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?