« Back to channel list

#RubyOnRails - 09 November 2017

« Back 1 day Forward 1 day »
[00:01:14] orbyt_: has joined #RubyOnRails
[00:04:12] jphase: has joined #RubyOnRails
[00:13:56] Coldblackice: has joined #RubyOnRails
[00:14:15] jphase: has joined #RubyOnRails
[00:16:29] Coldblackice: has joined #RubyOnRails
[00:17:23] Cache_Money: has left #RubyOnRails: ()
[00:19:16] Technodrome: has joined #RubyOnRails
[00:20:06] safetypin: has joined #RubyOnRails
[00:26:23] moei: has joined #RubyOnRails
[00:30:59] moei: has joined #RubyOnRails
[00:35:31] guacamole: has joined #RubyOnRails
[00:35:49] tcopeland: has joined #RubyOnRails
[00:38:23] simmerz: has joined #RubyOnRails
[00:39:13] simmerz: has joined #RubyOnRails
[00:39:58] simmerz: has joined #RubyOnRails
[00:40:38] simmerz: has joined #RubyOnRails
[00:41:24] cseder: has joined #RubyOnRails
[00:42:45] Jameser: has joined #RubyOnRails
[00:46:32] cagomez: has joined #RubyOnRails
[00:58:37] Exhiled: has joined #RubyOnRails
[01:01:11] cagomez: has joined #RubyOnRails
[01:11:59] sevenseacat: has joined #RubyOnRails
[01:23:47] xall: has joined #RubyOnRails
[01:30:24] jphase: has joined #RubyOnRails
[01:32:17] jphase_: has joined #RubyOnRails
[01:34:02] jphase__: has joined #RubyOnRails
[01:52:13] jphase: has joined #RubyOnRails
[01:57:34] Avon: has joined #RubyOnRails
[01:59:41] Exhiled: has joined #RubyOnRails
[02:13:46] mtkd: has joined #RubyOnRails
[02:18:51] Rythen: has joined #RubyOnRails
[02:20:17] Rythen: Hey guys. I'm just looking for a pointer to what I should read about for doing a certain thing with rails. Not sure if it would just need to be done with Ajax and JS. Say you are doing an app that has 2 client views that need to be synced. For simplicity think of an example like a tick tac toe game where when Player 1 makes a move you need to update the view of Player 2 etc etc. Is there a way to do this without having both
[02:21:12] Rythen: I'm new to rails so I'm just not sure where to look to find this info out and when I google I haven't found any useful info
[02:29:04] Exhiled: has joined #RubyOnRails
[02:31:48] Exhiled: has joined #RubyOnRails
[02:32:29] fragamus: has joined #RubyOnRails
[02:34:19] jphase: has joined #RubyOnRails
[02:35:30] jphase_: has joined #RubyOnRails
[02:47:08] Technodrome: has joined #RubyOnRails
[02:50:36] guacamole: has joined #RubyOnRails
[02:52:28] dogweather: has joined #RubyOnRails
[02:53:23] fox_mulder_cp: has joined #RubyOnRails
[02:54:08] Exhiled: has joined #RubyOnRails
[02:54:18] Axsuul: has joined #RubyOnRails
[02:54:33] jnollette: has joined #RubyOnRails
[02:56:42] xMopxShell: has joined #RubyOnRails
[02:56:44] tekk: has joined #RubyOnRails
[02:56:45] matthewd: has joined #RubyOnRails
[02:56:55] alfie: has joined #RubyOnRails
[02:57:31] atrius: has joined #RubyOnRails
[02:57:55] Gm4n: has joined #RubyOnRails
[02:57:57] leeky: has joined #RubyOnRails
[02:58:38] CustosLimen: has joined #RubyOnRails
[03:03:08] ltd: has joined #RubyOnRails
[03:04:53] Doldge: has joined #RubyOnRails
[03:05:47] frojnd: has joined #RubyOnRails
[03:06:58] KeyJoo: has joined #RubyOnRails
[03:12:31] cseder_: has joined #RubyOnRails
[03:15:45] Iacobus: has joined #RubyOnRails
[03:16:12] machty: has joined #RubyOnRails
[03:19:06] alfiemax: has joined #RubyOnRails
[03:19:25] guacamole: has joined #RubyOnRails
[03:20:12] davic: has joined #RubyOnRails
[03:21:44] tekk: has joined #RubyOnRails
[03:28:35] swgillespie: has joined #RubyOnRails
[03:31:25] irishfromua: has joined #RubyOnRails
[03:41:16] orbyt_: has joined #RubyOnRails
[03:47:48] [spoiler]: has joined #RubyOnRails
[03:55:25] lemur: has joined #RubyOnRails
[03:57:19] [spoiler]: has joined #RubyOnRails
[04:03:30] Gm4n: has joined #RubyOnRails
[04:19:25] srinidhi: has joined #RubyOnRails
[04:23:15] guacamole: has joined #RubyOnRails
[04:40:49] cam27: has joined #RubyOnRails
[04:54:50] guacamole: has joined #RubyOnRails
[05:00:35] KeyJoo: has joined #RubyOnRails
[05:01:11] cam27: THis RSpec and Capybara stuff is confusing, is there a clear thought on when I should be using one vs the other?
[05:01:32] cam27: Or are they both intertwined
[05:02:30] apeiros: has joined #RubyOnRails
[05:03:14] guacamole: has joined #RubyOnRails
[05:07:30] fryguy: cam27: they aren't the same thing. at all.
[05:08:07] fryguy: capybara is a set of tools for interacting with clients connecting to a webserver, rspec is a unit testing framework
[05:08:08] cam27: They both can use my factories though right?
[05:08:20] fryguy: uh. sure.
[05:09:01] cam27: Ok, and I’m on Capybara’s site now and it looks like this video is using out dated DSL, I think I’m going to have this working
[05:09:34] fryguy: the capybara dsl hasn't really changed in a long time
[05:10:08] srinidhi: has joined #RubyOnRails
[05:11:01] cam27: What do you use for testing?
[05:12:09] fryguy: depends on the project, most of the time minitest, capybara, and selenium-driver
[05:13:27] cam27: Ok. ANd I’m researching the differences of the rivers now, I was going to use poltergeist and Phantom, but not really sure why other than David Bryant’s book used them. But I wasn’t going to use Angular 1.5, I was going to try React
[05:17:41] aki_drk: has joined #RubyOnRails
[05:18:10] cam27: Thanks fryguy, I’m sure I’ll figure it all out. Just need a little more hands on :)
[05:18:22] cam27: Mostly just bored lol
[05:19:34] sagax: has joined #RubyOnRails
[05:20:39] aki_drk: Hello Everyone! I recently had the pleasure to start working in RoR and on to this Channel. I am having a small issue. I have a rails_admin setup (fairly easy) and I have a 1:m association mapped out. But it seems that in the parent table i am having one dropdown menu of the 2nd table and also an extra field with integer in it .... Any idea guys
[05:20:52] aki_drk: in the rails admin page
[05:37:11] ahrs: has joined #RubyOnRails
[05:37:36] quazimodo: has joined #RubyOnRails
[05:38:51] Exhiled: has joined #RubyOnRails
[05:39:33] quazimodo: hopsoft: I've switched us over to cyclejs
[05:39:59] quazimodo: and I've configured controllers to automatically expose a 'viewmodel' structure, both to the html.slim templates and to the front end via gon.
[05:40:30] quazimodo: all controllers perform 'operations' that return a result object. This contains all validations, success/error messages, etc. That stuff is pushed into ajax responses
[05:40:59] quazimodo: before cycle.js and composable operations that return result objects my team was _exactly_ in your bind
[05:41:31] quazimodo: now it's very very different. I think atm it's incredibly fast to develop quite sophisticated stuff
[05:41:46] quazimodo: and it feels good
[05:42:05] quazimodo: What's the concencus on actioncable, what's the performance like nowadays?
[05:43:09] apeiros: has joined #RubyOnRails
[05:45:12] Exhiled: has joined #RubyOnRails
[05:49:54] dionysus69: has joined #RubyOnRails
[06:07:37] apeiros: has joined #RubyOnRails
[06:07:47] shantanoo: has joined #RubyOnRails
[06:07:50] shantanoo: has left #RubyOnRails: ()
[06:07:57] shantanoo: has joined #RubyOnRails
[06:09:12] nickjj_: has joined #RubyOnRails
[06:10:38] blackcross_: has joined #RubyOnRails
[06:13:41] sunya7a_: has joined #RubyOnRails
[06:14:40] Kilobyte22: has joined #RubyOnRails
[06:15:18] epochwolf: has joined #RubyOnRails
[06:15:51] urkle: has joined #RubyOnRails
[06:15:54] swgillespie_: has joined #RubyOnRails
[06:16:53] Fridtjof: has joined #RubyOnRails
[06:17:29] beingjohnm: has joined #RubyOnRails
[06:18:53] quazimod1: has joined #RubyOnRails
[06:19:11] maryo_: has joined #RubyOnRails
[06:21:56] fl4sh__: has joined #RubyOnRails
[06:23:45] [spoiler]: has joined #RubyOnRails
[06:26:07] segy: has joined #RubyOnRails
[06:29:27] KeyJoo: has joined #RubyOnRails
[06:29:57] tekk: has joined #RubyOnRails
[06:34:39] duderonomy: has joined #RubyOnRails
[06:35:40] apeiros: has joined #RubyOnRails
[06:46:05] guacamole: has joined #RubyOnRails
[06:52:25] apeiros: has joined #RubyOnRails
[06:56:53] MrCrackPotBuilde: has joined #RubyOnRails
[06:59:33] srinidhi: has joined #RubyOnRails
[07:03:25] DoubleMalt: has joined #RubyOnRails
[07:05:45] apeiros: has joined #RubyOnRails
[07:10:05] doublemalt_: has joined #RubyOnRails
[07:11:30] alfiemax: has joined #RubyOnRails
[07:12:51] phon: has joined #RubyOnRails
[07:30:12] Technodrome: has joined #RubyOnRails
[07:30:44] apeiros: has joined #RubyOnRails
[07:32:25] AzaToth: has joined #RubyOnRails
[07:36:59] conta: has joined #RubyOnRails
[07:39:20] apeiros: has joined #RubyOnRails
[07:44:51] Technodrome: has joined #RubyOnRails
[07:46:39] phon: has joined #RubyOnRails
[08:03:58] MrCrackPotBuilde: hello i figured out how to get a page to load a certain way with a certain style sheet but i came across something that in future might do.
[08:04:12] MrCrackPotBuilde: can you have say a css file for a partial
[08:04:25] MrCrackPotBuilde: so nothing else is modified in the entire app
[08:07:43] tbuehlmann: MrCrackPotBuilde: what?
[08:14:59] baweaver: MrCrackPotBuilde: http://getbem.com/introduction/
[08:15:12] baweaver: BEM is a naming convention that addresses that issue.
[08:18:55] dionysus69: has joined #RubyOnRails
[08:24:53] ur5us: has joined #RubyOnRails
[08:37:40] xibalba: has joined #RubyOnRails
[08:42:06] ur5us: has joined #RubyOnRails
[08:43:19] sunya7a_: I have 3 models: A has many B and B has many C. I'm using delegate to get from C to A. Given a collection proxy of C's how can I get the corresponding A's? I've tried using delegate in the B model to help bridge from C to A, but it doesn't do what I expect it to
[08:45:14] iamarun: has joined #RubyOnRails
[08:50:14] kies: has joined #RubyOnRails
[08:56:05] apeiros: has joined #RubyOnRails
[09:06:27] ferr: has joined #RubyOnRails
[09:07:27] apeiros: has joined #RubyOnRails
[09:23:29] Ergo: has joined #RubyOnRails
[09:26:23] mikecmpbll: has joined #RubyOnRails
[09:27:52] apeiros: has joined #RubyOnRails
[09:31:18] AntiSpamMeta: has joined #RubyOnRails
[09:31:39] ArTiSTiX: has joined #RubyOnRails
[09:31:41] dustinm`: has joined #RubyOnRails
[09:34:10] apeiros: has joined #RubyOnRails
[09:38:35] nausea: has joined #RubyOnRails
[09:41:35] CustosLimen: has joined #RubyOnRails
[09:44:41] apeiros: has joined #RubyOnRails
[09:45:34] quazimodo: has joined #RubyOnRails
[09:58:34] simmerz: has joined #RubyOnRails
[10:03:31] mikecmpbll: has joined #RubyOnRails
[10:04:00] apeiros: has joined #RubyOnRails
[10:05:11] ferr: has left #RubyOnRails: ("WeeChat 1.9.1")
[10:08:30] alfiemax: has joined #RubyOnRails
[10:23:42] ur5us: has joined #RubyOnRails
[10:29:33] apeiros: has joined #RubyOnRails
[10:32:24] workmad3: has joined #RubyOnRails
[10:40:06] marr: has joined #RubyOnRails
[10:44:48] simmerz: has joined #RubyOnRails
[10:45:15] ur5us: has joined #RubyOnRails
[10:45:49] simmerz: has joined #RubyOnRails
[10:46:27] simmerz: has joined #RubyOnRails
[10:47:24] simmerz: has joined #RubyOnRails
[10:48:14] simmerz: has joined #RubyOnRails
[10:58:36] simmerz: has joined #RubyOnRails
[11:06:58] ur5us: has joined #RubyOnRails
[11:07:06] BloodyMer: has joined #RubyOnRails
[11:10:09] mikecmpbll: has joined #RubyOnRails
[11:25:06] rgr: has joined #RubyOnRails
[11:28:29] ur5us: has joined #RubyOnRails
[11:49:22] mikecmpb_: has joined #RubyOnRails
[11:50:03] ur5us: has joined #RubyOnRails
[12:04:10] ma5ter: has joined #RubyOnRails
[12:07:25] noob_on_rails: has joined #RubyOnRails
[12:09:22] simmerz: has joined #RubyOnRails
[12:11:33] ur5us: has joined #RubyOnRails
[12:11:52] noob_on_rails: hey all , where is the correct place to ask for help on planning a heroku deployment?
[12:12:30] ams__: has joined #RubyOnRails
[12:25:20] workmad3: has joined #RubyOnRails
[12:27:01] mostlybadfly: has joined #RubyOnRails
[12:33:08] ur5us: has joined #RubyOnRails
[12:43:01] quazimodo: has joined #RubyOnRails
[12:45:33] sevenseacat: has joined #RubyOnRails
[12:48:31] truenito: has joined #RubyOnRails
[12:48:33] apparition: has joined #RubyOnRails
[12:50:46] quazimodo: has joined #RubyOnRails
[12:54:38] ur5us: has joined #RubyOnRails
[13:16:18] ur5us: has joined #RubyOnRails
[13:21:09] keegnotrub: has joined #RubyOnRails
[13:21:30] codelahoma: has joined #RubyOnRails
[13:27:49] jphase: has joined #RubyOnRails
[13:34:15] nzst: has joined #RubyOnRails
[13:37:45] ur5us: has joined #RubyOnRails
[13:39:23] dionysus69: Can anyone suggest a nice resource where I can learn how would for example android user sign up / sign in into the rails through json api calls?
[13:39:52] dionysus69: preferably through existing devise actions, so I dont have to duplicate controllers/actions
[13:42:55] nzst: This is just an example, https://github.com/lynndylanhurley/devise_token_auth, but you want to look into json token auth
[13:45:39] jphase: has joined #RubyOnRails
[13:48:03] workmad3: I'd probably suggest setting up something like doorkeeper for oauth personally, having the API authenticated with oauth tokens, and then having the app obtain a token through the password grant type
[13:59:19] ur5us: has joined #RubyOnRails
[14:00:15] dionysus69: workmad3, nzst: thanks I will look into both options
[14:07:28] dionysus69: is this considered not maintained? should I just use vanilla oauth2 library ?
[14:07:32] dionysus69: https://github.com/intridea/oauth2
[14:20:28] noob_on_rails: dionysus69: why not use Devise?
[14:20:36] dionysus69: I am already using devise
[14:20:43] dionysus69: does devise support token authentication?
[14:20:57] ur5us: has joined #RubyOnRails
[14:21:14] noob_on_rails: i think so yea , i've done a project which devise is in a --api
[14:21:31] dionysus69: ok great then I guess will look into that first
[14:21:34] noob_on_rails: and i do all the devise actions with Ember js
[14:22:58] srkska: has joined #RubyOnRails
[14:25:31] noob_on_rails: Anyone on what's the correct place to ask for a heroku deployment ?
[14:25:45] noob_on_rails: not to much programming stuff, only like , whats a good plan and such
[14:27:53] dionysus69: dont really know channel for that but I guess ask here and if someone is on good mood :D ...
[14:28:39] dionysus69: noob_on_rails: is your ember app open source? if I may see what you are sending to devise and how you are handling auth
[14:30:09] noob_on_rails: dionysus69: umm sadly it's not opensource
[14:30:17] noob_on_rails: i've been thinking to make a good example
[14:30:23] noob_on_rails: and push it on github some time now
[14:30:37] noob_on_rails: but im pretty occupied atm :/
[14:30:49] noob_on_rails: i can try to help you though
[14:30:52] dionysus69: ok I am heading out now :D I ll ask you sometime later, month long project anyway
[14:31:04] dionysus69: kk thanks xD
[14:36:33] apeiros: has joined #RubyOnRails
[14:40:44] ule: Do you guys know if ActiveRecord::Base.establish_connection creates a new connection_pool?
[14:41:58] ule: Also, is it bad if I use establish_connection on a controller instead of a model?
[14:42:27] ur5us: has joined #RubyOnRails
[14:43:20] apeiros: has joined #RubyOnRails
[14:49:31] ule: https://stackoverflow.com/questions/7191139/understanding-how-establish-connection-works-in-activerecord
[14:49:36] ule: ^ nice post
[14:53:20] truenito: has joined #RubyOnRails
[14:59:11] jottr: has joined #RubyOnRails
[15:03:59] nzst: ule: have you seen this gem https://github.com/ankane/multiverse ?
[15:04:04] ur5us: has joined #RubyOnRails
[15:04:12] nzst: just showed up in a weekly, fyi
[15:04:47] ule: nzst: let me check
[15:04:57] ule: sweet, pretty recent
[15:06:43] ule: looks like its using the same idea. Hooking up to the Models instead of controllers
[15:07:11] ule: I'm not sure if doing it on controllers will cost too much network handshakes on authorization/connections every time
[15:07:45] ule: Idealy I'd like to keep 2 connection_pools when I bootstrap the application and then inside my controller I would just switch between them
[15:12:05] ule: nzst: is that github yours? you created that?
[15:13:28] nzst: no, like I said it showed up in a weekly and you've been on about this topic for a couple days. I thought it could be helpful
[15:13:49] ule: nzst: yeah, thank you very much
[15:13:55] ule: I'll dig inside this lib to see what it does
[15:15:05] Technodrome: has joined #RubyOnRails
[15:17:15] mtkd: has joined #RubyOnRails
[15:19:56] doublemalt_: has joined #RubyOnRails
[15:21:49] knight33: has joined #RubyOnRails
[15:23:39] dionysus69: has joined #RubyOnRails
[15:25:31] ur5us: has joined #RubyOnRails
[15:25:38] bronson: has joined #RubyOnRails
[15:41:53] iamarun: has joined #RubyOnRails
[15:47:04] ur5us: has joined #RubyOnRails
[15:55:49] truenito: has joined #RubyOnRails
[15:59:20] aScottishBoat: has joined #RubyOnRails
[16:01:05] aScottishBoat: I'm getting this (https://pastebin.com/MTKz8HmQ) error message when running `rails s`, or even `rails -h`. How I tried fixing it: 1) `bundle config --delete bin`, then 2) `rails app:update:bin`. That, however, throws the same error message as the pastebin
[16:02:22] aScottishBoat: So `rails` throws the error message when I'm in the app directory.
[16:02:29] mikecmpbll: has joined #RubyOnRails
[16:02:30] aScottishBoat: But not from outside of it
[16:03:03] orbyt_: has joined #RubyOnRails
[16:08:38] ur5us: has joined #RubyOnRails
[16:12:43] cagomez: has joined #RubyOnRails
[16:17:54] mikecmpbll: has joined #RubyOnRails
[16:26:17] Exhiled: has joined #RubyOnRails
[16:27:53] truenito: has joined #RubyOnRails
[16:30:17] ur5us: has joined #RubyOnRails
[16:31:48] weaksauce: has joined #RubyOnRails
[16:33:06] troys: has joined #RubyOnRails
[16:33:17] tycoon177: i am trying to install nokogiri in a docker container and am having troubles figuring out what is causing it to fail. Here is the mkmf.log file https://gist.github.com/BenMcH/dba41b31ac88d9a5af0d1996aa38a96c
[16:34:02] tycoon177: i'm not seeing any errors, just warnings
[16:36:19] fryguy: where's the rest of the output?
[16:36:34] tycoon177: fryguy: that's all that's in the file
[16:36:43] fryguy: also it's likely due to you using alpine linux instead of something else
[16:36:55] tycoon177: fryguy: i checked gem_make.out and i'm investigating why libxml2 failed to compile.
[16:37:10] tycoon177: and i'm using alpine to try to reduce docker image sizes, per dminuoso's suggestion
[16:37:18] fryguy: you might want to try using a container that provides libc instead of musl, or try using a newer version of nokogiri which might have support for musl
[16:38:24] aScottishBoat: bump: https://pastebin.com/MTKz8HmQ I built ManageIQ/MiQ UI Classic from source, and when I `bundle exec rails s`, I get the error message. I work through the solutions it mentions but it just throws the same error.
[16:41:33] [Butch]: has joined #RubyOnRails
[16:46:47] tycoon177: fryguy: it turns out i was missing libxslt-dev :) ty for your willingness to help though!
[16:51:20] Papierkorb: has joined #RubyOnRails
[16:51:49] ur5us: has joined #RubyOnRails
[17:00:37] truenito: has joined #RubyOnRails
[17:02:16] dviola: has joined #RubyOnRails
[17:03:35] Exhiled: has joined #RubyOnRails
[17:10:24] Jon30: are RoR developers too cool for IRC?
[17:10:38] Jon30: Are they all on Slack? :)
[17:13:15] ur5us: has joined #RubyOnRails
[17:13:24] conta2: has joined #RubyOnRails
[17:15:17] one_zero: has joined #RubyOnRails
[17:19:56] cagomez: has joined #RubyOnRails
[17:23:39] Hates_: has joined #RubyOnRails
[17:32:33] cam27: has joined #RubyOnRails
[17:33:08] tens0r: has joined #RubyOnRails
[17:34:56] ur5us: has joined #RubyOnRails
[17:35:10] dionysus69: has joined #RubyOnRails
[17:38:07] Saukk: has joined #RubyOnRails
[17:41:31] weaksauce: has joined #RubyOnRails
[17:47:52] cagomez: has joined #RubyOnRails
[17:48:15] Saukk: has joined #RubyOnRails
[17:49:47] Saukk: has joined #RubyOnRails
[17:52:15] Saukk: has joined #RubyOnRails
[17:53:15] Saukk: has joined #RubyOnRails
[17:53:25] mikecmpbll: has joined #RubyOnRails
[17:54:26] Saukk: has joined #RubyOnRails
[17:55:10] orbyt_: has joined #RubyOnRails
[17:56:28] ur5us: has joined #RubyOnRails
[17:59:21] Exhiled: has joined #RubyOnRails
[18:07:55] ule: Jon30: I guess you're talking about js developers. Not Rails
[18:08:13] Cache_Money: has joined #RubyOnRails
[18:08:24] Jon30: You mean JS developers love to hang out on Slack?
[18:08:25] cagomez: has joined #RubyOnRails
[18:09:29] RedMachine: has joined #RubyOnRails
[18:09:33] cagomez_: has joined #RubyOnRails
[18:10:35] ule: Jon30: IRC is old school. The new generation is on Slack man. Not surprise your nick is Jon "30". I bet 90% of folks on IRC is ~30
[18:10:51] RedMachine: Irc is more Low-Key when you're at work bro.
[18:11:01] ule: thats true
[18:11:03] tcopeland: right on ^^
[18:11:15] RedMachine: I use Weechat on my term
[18:11:26] Jon30: Ohhh, but we're using Slack at work so I can probably join the RoR slack chan
[18:11:43] ule: Jon30: do you know a good slack channel?
[18:11:49] orbyt_: has joined #RubyOnRails
[18:12:02] Jon30: http://www.rubyonrails.link/
[18:12:03] RedMachine: I have Slack at work, but no one uses it. WOn't they notice if you're using a Slack a bunch but they see 0 activity?
[18:12:05] Jon30: I believe it's this one
[18:13:17] RedMachine: I've been upgrading my Rails applications at work from 4 -> 5.1. Anyone else been doing that?
[18:14:06] Jon30: Meow bot?
[18:14:19] ule: RedMachine: I did from 4.1 to 4.2.9 It was a good chunk of code
[18:14:27] Jon30: My workplace doesn't believe in updating
[18:14:49] ule: RedMachine: My PR had 90 commits :D
[18:15:28] RedMachine: ule: My applications are super basic CRUD apps. My PR has like 15 commits lol. I feel for you. My applications are just internal. Plus they don't have any "users
[18:15:50] kies: has joined #RubyOnRails
[18:15:52] ule: RedMachine: good for you man
[18:16:08] ule: I'm sitting on top of a 5 years old rails app here
[18:16:22] ule: but slowly getting better
[18:17:09] RedMachine: Most of my updates were actually RSpec related. Testing suites got a little hairy with the 4->5 jump?
[18:17:58] ur5us: has joined #RubyOnRails
[18:23:19] nzst: has joined #RubyOnRails
[18:23:53] ur5us: has joined #RubyOnRails
[18:29:38] orbyt_: has joined #RubyOnRails
[18:35:04] baweaver: ACTION starts to type out rejection of the idea we're all ~30
[18:35:10] baweaver: ACTION then realizes he's ~30
[18:35:19] baweaver: ACTION bows head in shame
[18:35:57] baweaver: Both of them are fairly popular, though I still stick around IRc.
[18:36:14] Puffball: has joined #RubyOnRails
[18:36:52] Saukk: has joined #RubyOnRails
[18:41:49] uks: has joined #RubyOnRails
[18:47:55] Exhiled: has joined #RubyOnRails
[18:48:31] ule: baweaver: welcome to the club buddy
[18:48:49] baweaver: Still have a few years, at 27 currently
[18:49:20] truenito: has joined #RubyOnRails
[18:53:30] orbyt_: has joined #RubyOnRails
[18:55:56] tens0r: has joined #RubyOnRails
[18:59:01] sagax: has joined #RubyOnRails
[19:00:13] Cache_Money: has left #RubyOnRails: ()
[19:01:22] hammer065: has joined #RubyOnRails
[19:09:05] ur5us: has joined #RubyOnRails
[19:11:43] conta3: has joined #RubyOnRails
[19:17:45] FrostCandy: has joined #RubyOnRails
[19:18:55] Dimik: has joined #RubyOnRails
[19:22:38] SteenJobs: has joined #RubyOnRails
[19:34:17] pche: has joined #RubyOnRails
[19:51:43] dgsan: Anyone know a way to set :invalid and :valid psuedoclass states from a browser's dev tools?
[19:56:05] KeyJoo: has joined #RubyOnRails
[20:09:47] cagomez: has joined #RubyOnRails
[20:14:27] cincy_kal: has joined #RubyOnRails
[20:15:10] cincy_kal: I have a question regarding exception handling. Do most of you rescue exceptions in service objects or the controller?
[20:15:40] simmerz: has joined #RubyOnRails
[20:21:41] dgsan: "it depends" Rescue explicit types of exceptions in the place it makes the most sense to rescue them. Do NOT rescue generic/all exceptions.
[20:28:20] ^mtkd: has joined #RubyOnRails
[20:32:35] dminuoso: cincy_kal: Rescue when you can handle.
[20:32:38] dminuoso: If you cant, let it propagate.
[20:33:02] dkotlica: has joined #RubyOnRails
[20:34:53] cincy_kal: I ask this because I see a lot of people using status objects in a service and rescuing from there. These objects often look like {success?: false, error: my_error, result: nil}. Which is fine, but if you are calling multiple services from another service, then the exception gets handled in the inner service and won't propogate to the outer. That then would require you to handle the results of each service and manually handle
[20:35:52] dminuoso: cincy_kal: You miss the point.
[20:36:03] dminuoso: cincy_kal: If you cannot handle an exception gracefully, do not rescue it.
[20:36:09] dkotlica: has left #RubyOnRails: ("Leaving")
[20:36:17] dminuoso: To rescue means to be able to recover from an exceptional state.
[20:36:53] dminuoso: cincy_kal: Also, the error state would still propagate, even if only through some success?: false
[20:37:13] dkotlica: has joined #RubyOnRails
[20:41:39] cincy_kal: but most would rescue at the barrier of the logic (i.e. the controller that calls the outer service). so if for instance you have RegisterUser service which then calls a SendConfirmationEmail service, which uses SendEmail service, and the Send email service catches a failure then returns a status object of {success? false, error: 'Mailer failed to send email', result: nil}, then you have to manually check that within the Send
[20:42:22] cincy_kal: then you have to not continue in the SendConfirmationEmail service, return that status object up to the RegisterUserService which then needs to handle it and send it up to the controller
[20:43:14] cincy_kal: whereas not rescuing and letting the exception propogate up to the controller where you render the error seems like the simpler way to handle it, even if that means having a few "rescue" lines
[20:43:34] noob_on_rails: has joined #RubyOnRails
[20:43:50] noob_on_rails: hey all , anyone has deployed to heroku and used the bonsai elasticsearch addon?
[20:45:23] dminuoso: cincy_kal: I think you may be overservicing things.
[20:45:42] dminuoso: If you have a SendConfirmationEmailService, you may be trying too hard to do Java in rails.
[20:45:50] cincy_kal: that was just an example off the top of my head. But it is not uncommon to call other services from another service
[20:47:24] cincy_kal: following SRP with a service lends itself to these situations in order to maintain skinny models and skinny controllers
[20:49:02] cincy_kal: take this article for example... https://hackernoon.com/going-further-with-service-objects-in-ruby-on-rails-b8aac13a7271
[20:50:28] cincy_kal: The NotifySlack service could easily be used throughout multiple other services. It also uses an external api therefore is subject to failure, yet in that service the author doesn't rescue the errors or return the status object
[20:52:25] cincy_kal: So in that situation you have some services where you utilize a status object and other services where you don't. That inconsistency is what can lead to harder to understand code. Someone may get into the codebase and ask, "why do some services handle their exceptions while other services do not? why do some services use status objects and others do not?"
[20:53:34] cincy_kal: Its just a pattern that I see lending itself to headaches in larger codebases, and introducing potential points of failure and unhandled exceptions
[20:58:21] cincy_kal: maybe im missing something, but i feel like i have valid concerns. I was hoping someone here might be able to tell me if im seeing this the wrong way
[20:59:51] dgsan: cincy_kal: In your latest example my question would be why not hand off those things to some sort of lightweight job or queue system instead of having them be potential sources of failure for the main request response.
[21:02:19] dgsan: (Lately I've been having my apps do things like send email or notify slack or do some business process X in jobs, which then can worry about their own failures and not worry the main app.)
[21:04:24] cincy_kal: i understand that. And I actually use jobs for a lot of those things in my professional gig. but that blog post is giving an example that i see as brittle, and using status objects sometimes and not others seems like a bad idea
[21:04:31] noob_on_rails: any other alternative to the 2 big guys Solr / Elasticsearch , that does not need heroku addons to work ?
[21:05:06] noob_on_rails: maybe pg_search / acts_as_indexed ?
[21:06:55] baweaver: ACTION reads through large thread
[21:06:58] workmad3: has joined #RubyOnRails
[21:08:57] baweaver: An exception should only really be thrown for something exceptional, not for flow control. That's one of the common misconceptions there.
[21:09:12] ur5us: has joined #RubyOnRails
[21:09:24] baweaver: A failed service request would potentially be considered exceptional, but at the same time it's a very possible thing to happen in the flow of the app is that it fails
[21:09:43] dkotlica: has left #RubyOnRails: ("Leaving")
[21:09:50] baweaver: Exceptions to me mean something you cannot recover from at the edge-cases of your app
[21:10:28] baweaver: So I would argue that returning an exception from the Slack service doesn't make much sense. I'd treat it like HTTP: it returns 4xx+ for errors and lets you control flow from there
[21:11:16] cagomez: has joined #RubyOnRails
[21:11:30] baweaver: An exception is saying I give up, someone else handle this mess
[21:11:40] baweaver: versus I got a bad response, here you go
[21:13:14] xco: has joined #RubyOnRails
[21:13:49] ule: baweaver: uncle bob disagrees
[21:13:50] cincy_kal: that is a fair argument, and it seems a lot of blog posts do use exceptions for breaking out code when an error happens, but handling them within the service. Which is kind of why I'm inquiring on that here. because i see issue with that
[21:14:18] xco: is there a way with active record to pass in 2 ids when i want results with either of the IDs? Example User.where(user_id: 1 OR 2) how will i do something like that? is it possible?
[21:14:32] baweaver: Uncle Bob is not the be-all-to-end-all either.
[21:14:54] cincy_kal: i've always handled exceptions at the barrier of the app which in a rails api would be the controller. it the uppermost point of "handle the error or response and render view"
[21:14:57] cagomez: has joined #RubyOnRails
[21:15:08] ule: baweaver: he says that we shouldn't propagate something to the next method if something is wrong. So you don't need to in every method be doing something.. (do I have this object valid?, yes, lets proceed)
[21:15:20] baweaver: xco: User.where(id: [1,2]) -> SELECT * FROM User AS user WHERE user.id IN [1, 2]
[21:15:51] xco: baweaver: thank you didn’t know about this
[21:16:08] baweaver: It's a FP concept to propagate those values. It's an OO misnomer to pass it up 10 chains because you made tons of intermediary objects
[21:16:24] baweaver: Demeter is watching
[21:17:01] baweaver: In any caseIf you have so many layers of indirection that you have to worry about how often you propagate something you're making a bigger mess.
[21:18:01] baweaver: Too DRY is BRITTLE: Badly Refactored into Tiny Things Lacking Expressiveness
[21:19:37] nzst: has left #RubyOnRails: ("Using Circe, the loveliest of all IRC clients")
[21:28:14] orbyt_: has joined #RubyOnRails
[21:30:19] alfiemax: has joined #RubyOnRails
[21:34:36] cincy_kal: i see i have touched on an easily debated topic :)
[21:35:48] baweaver: The short version of my answer is if passing that up a chain is painful your Object layout is too complicated.
[21:36:20] cincy_kal: Its a fine line to balance SRP for the sake of maintainability and easy testing, vs code integrity. easy to get carried away and as ive shown easy to overthink
[21:37:02] baweaver: SRP too early leads to bad abstractions
[21:37:16] cincy_kal: im going to be refactoring many of the services for work as there are some that the previous team created with 1500+ lines of code. Absolutely violates SRP. But before I do the refactor, I want a solid gameplan
[21:37:47] baweaver: Write a delegation class that masks the current implementation
[21:38:03] baweaver: Then change code relying on the old way to hit the new way, then migrate methods piecemeal
[21:38:29] baweaver: That way it's easier to throw out abstractions in the process and not get too reliant on them
[21:38:48] FLeiXiuS: has joined #RubyOnRails
[21:38:56] baweaver: you just make a new delegator that points to the same data for each break and rearrange them until you like it with no effect on the current running implementation.
[21:39:22] FLeiXiuS: I have a DB handler setup like this, http://imnithin.in/multiple-database.html. However, whenever my database goes offline, the connect never resets.
[21:39:44] cincy_kal: not a terrible idea. I've seen ruby blogs on using "commands" which is essentially a layer between a controller and services. The command is responsible for dispatching to the services and catching the errors, then returning the proper response to the controller.
[21:39:47] mostlybadfly: has joined #RubyOnRails
[21:40:42] cincy_kal: But although they call them "commands" they don't seem to be what the oop Command Design Pattern really is
[21:43:53] baweaver: I always have a bit of skepticism with 1-1 implementations of GoF patterns in Ruby as it does have a lot of power from the FP side of things which makes some of them a bit irrelevant
[21:45:47] baweaver: https://www.voxxed.com/2016/04/gang-four-patterns-functional-light-part-1/
[21:45:48] baweaver: Mario Fusco is a long time Java guy and has some great insights on some of this
[21:46:21] baweaver: There are 4 parts but it's well worth the time to learn how you can hybrid to pare down some of the patterns
[21:47:05] cincy_kal: ill check those out. i need to hop off here but thanks for conversing on this.
[21:49:12] Coldbla1: has joined #RubyOnRails
[21:54:59] apeiros_: has joined #RubyOnRails
[22:06:34] hahuang65: has joined #RubyOnRails
[22:16:04] phon: has joined #RubyOnRails
[22:17:00] phon: has joined #RubyOnRails
[22:19:52] Technodrome: has joined #RubyOnRails
[22:22:43] sonOfRa: has joined #RubyOnRails
[22:23:21] alfiemax: has joined #RubyOnRails
[22:28:26] kies: has joined #RubyOnRails
[22:35:24] Radar: GOOD MORNING
[22:40:50] xco: has joined #RubyOnRails
[22:43:18] xco: how can i save some AR results to csv in rails and have it sent in an email? so for example how can i save something like this User.where(id: 1) where User has columns say :name and :surname?
[22:44:45] jottr: has joined #RubyOnRails
[22:55:57] jottr: has joined #RubyOnRails
[22:59:58] Technodrome: has joined #RubyOnRails
[23:02:16] mtkd: has joined #RubyOnRails
[23:02:54] jphase: has joined #RubyOnRails
[23:14:27] jphase: has joined #RubyOnRails
[23:18:01] jphase_: has joined #RubyOnRails
[23:24:22] jphase: has joined #RubyOnRails
[23:35:50] jphase: has joined #RubyOnRails
[23:37:40] jphase_: has joined #RubyOnRails
[23:42:23] ArTiSTiX_: has joined #RubyOnRails
[23:44:29] apeiros_: xco: require 'csv', for the rest, see CSV's documentation: http://ruby-doc.org/stdlib-2.4.2/libdoc/csv/rdoc/index.html
[23:45:22] apeiros: you can use some_user.attributes.values_at("name", …) to get the array of data for a single row
[23:47:21] xco: apeiros: where “some_user” is the model name? like User.attributes….?
[23:47:48] apeiros: xco: no, where some_user is one instance of your User model
[23:48:04] apeiros: since you probably want one row per user
[23:51:42] xco: apeiros: so i can do someting likse users = User.all then users.each do { |u| u.attributes.values_at.....
[23:52:18] apeiros: yes. you'd probably also want to create a CSV instance. and not use both `do` and `{` ;-)
[23:52:26] lupine: Except don't if you have more than a few users
[23:52:45] elomatreb: Can't you also use .pluck(:some, :attributes) to have the database do some more for you?
[23:52:59] elomatreb: I.e. User.all.pluck(:name, :email)
[23:53:00] lupine: Use the batching functionality for sanity. Skip AR instantiation entirely if you don't need any of the ruby logic
[23:53:10] xco: elomatreb: i’m alrady using pluck :)
[23:53:31] elomatreb: Mh, ok. I wasn't reading the scrollback, sorry
[23:54:31] xco: lupine: i’m doing .limit(1000) on users if that’s more than a few then i’m screwed i guess
[23:55:04] lupine: Eh, a thousand is probably fine
[23:55:13] lupine: A million would not be
[23:55:22] orbyt_: has joined #RubyOnRails
[23:55:32] apeiros: depends. what's nowadays attachment limits? 20MB?
[23:56:08] apeiros: if your average users' name + email is less than 20 bytes :D
[23:56:14] apeiros: (yeah, yeah, unlikely)
[23:57:38] xco: think it won’t reach 20mb
[23:57:47] baweaver: Depends if you have any Targaryans apeiros
[23:57:49] xco: but google accepts 20mb attachments i blwieve
[23:58:02] xco: or more
[23:58:03] xco: not sure
[23:58:03] user121212: has joined #RubyOnRails
[23:58:49] baweaver: Daenerys Stormborn of the House Targaryen, First of Her Name, the Unburnt, Queen of the Andals and the First Men, Khaleesi of the Great Grass Sea, Breaker of Chains, and Mother of Dragons.
[23:58:53] baweaver: Tinge more than 20b