« Back to channel list

#RubyOnRails - 16 November 2017

« Back 1 day Forward 1 day »
[00:09:25] orbyt_: has joined #RubyOnRails
[00:17:03] Cache_Money: has joined #RubyOnRails
[00:20:57] alfiemax: has joined #RubyOnRails
[00:22:43] tcopeland: has joined #RubyOnRails
[00:31:14] mtkd: has joined #RubyOnRails
[00:36:57] peterhil: has joined #RubyOnRails
[00:39:42] Jameser: has joined #RubyOnRails
[00:49:06] shtirlic: has joined #RubyOnRails
[00:54:46] shtirlic: has joined #RubyOnRails
[00:55:33] sevenseacat: has joined #RubyOnRails
[01:05:19] shtirlic: has joined #RubyOnRails
[01:14:53] orbyt_: has joined #RubyOnRails
[01:22:49] helpa: has joined #RubyOnRails
[01:25:48] cagomez: has joined #RubyOnRails
[01:25:59] cagomez: has joined #RubyOnRails
[01:26:59] mtkd: has joined #RubyOnRails
[01:28:19] mr-spoon: has joined #RubyOnRails
[01:28:20] one_zero: has joined #RubyOnRails
[01:28:20] maryo: has joined #RubyOnRails
[01:28:20] bga57: has joined #RubyOnRails
[01:28:20] ArTiSTiX_: has joined #RubyOnRails
[01:28:20] segy: has joined #RubyOnRails
[01:28:20] fumk: has joined #RubyOnRails
[01:28:20] clamstar: has joined #RubyOnRails
[01:28:20] planigan: has joined #RubyOnRails
[01:28:20] ProofTechnique: has joined #RubyOnRails
[01:28:20] lord4163: has joined #RubyOnRails
[01:28:20] levifig: has joined #RubyOnRails
[01:28:20] Jon30: has joined #RubyOnRails
[01:28:20] Fire-Dragon-DoL: has joined #RubyOnRails
[01:28:20] w0rd-driven: has joined #RubyOnRails
[01:28:20] jrgifford: has joined #RubyOnRails
[01:28:20] dcope: has joined #RubyOnRails
[01:28:20] mudyc: has joined #RubyOnRails
[01:28:20] loglaunch: has joined #RubyOnRails
[01:28:20] kanzure: has joined #RubyOnRails
[01:28:20] michael_mbp: has joined #RubyOnRails
[01:29:15] one_zero: has joined #RubyOnRails
[01:31:20] shtirlic: has joined #RubyOnRails
[01:33:26] clamstar: has joined #RubyOnRails
[01:36:08] michael_mbp: has joined #RubyOnRails
[01:43:44] Radar: !botsnack
[01:43:44] helpa: Nom nom. Thanks, Radar!
[01:49:50] ornerymoose: has joined #RubyOnRails
[01:50:12] bitch: !botsnack
[01:52:32] alfiemax: has joined #RubyOnRails
[02:00:29] helpa: Nam nam. Thonks, sevenseacat!
[02:26:48] irishfromua: has joined #RubyOnRails
[02:30:48] divoxx: has joined #RubyOnRails
[03:20:07] srinidhi: has joined #RubyOnRails
[03:21:49] mr-spoon: has joined #RubyOnRails
[03:23:05] uksio: has joined #RubyOnRails
[03:25:10] duderonomy: has joined #RubyOnRails
[03:36:49] orbyt_: has joined #RubyOnRails
[03:42:35] someish: has joined #RubyOnRails
[03:44:07] bholzer: has joined #RubyOnRails
[03:45:54] bholzer: I have something giving me trouble. I have an array of pairs, with the pairs being a representation of how a local model should be mapped to a remote template. I have this snippet:
[03:45:58] bholzer: https://gist.github.com/bholzer/2b62a9e8aac797d2a0b578231e9105d3
[03:46:03] easzero: has joined #RubyOnRails
[03:47:08] bholzer: Essentially, I loop through the pairs, grabbing a template, duping it and setting a reference id. The problem is that the objects in mapped_things do not retain the change made in line 5. Any idea why?
[03:52:35] sevenseacat: that code is really confusing
[03:52:55] sevenseacat: what is `template` on line 6
[03:55:30] bholzer: sevenseacat: I updated the code, it was a typo
[03:55:57] sevenseacat: ACTION grumbles about fake code
[04:07:53] Radar: bholzer: hi.
[04:08:03] Radar: bholzer: it would help us to know what pairs is and what your intention with this code is.
[04:09:13] bholzer: Radar: pairs is an array with pairs that are [thing_id, template_id], meant to map a "thing" to a template
[04:10:25] bholzer: This code takes that array of pairs, to find and return templates to the client with a thing_id set
[04:10:51] bholzer: The problem is, thing_id is not remaining set
[04:12:35] Saukk: has joined #RubyOnRails
[04:16:25] Radar: bholzer: you could probably do pairs.map do |(thing_id, template_id)|
[04:16:43] Radar: that would prevent the ugly pair.first / pair.second.
[04:17:50] Radar: bholzer: nothing stands out to me as to why that wouldn't change.
[04:18:11] bholzer: Ah cool, didn't know I could destructure like that
[04:23:21] ornerymoose: has joined #RubyOnRails
[04:34:23] TViernion: has joined #RubyOnRails
[04:37:24] podlech: has joined #RubyOnRails
[04:45:53] ornerymoose: has joined #RubyOnRails
[04:48:17] jackhum: has joined #RubyOnRails
[04:58:31] mr-spoon: has joined #RubyOnRails
[05:03:12] helpa: has joined #RubyOnRails
[05:15:02] mr-spoon: has joined #RubyOnRails
[05:19:16] iamarun: has joined #RubyOnRails
[05:27:24] irishfromua: has joined #RubyOnRails
[06:00:58] alexday: has joined #RubyOnRails
[06:01:37] Dimik: has joined #RubyOnRails
[06:07:50] baweaver: Radar: I just realized something really fun
[06:08:13] baweaver: [{a: 1, b: 2}, {a: 3}].map { |a:, b: 5| a + b }
[06:25:02] Aherin: has joined #RubyOnRails
[06:27:30] blackcross: has joined #RubyOnRails
[06:38:26] easzero: has joined #RubyOnRails
[07:01:12] phon: has joined #RubyOnRails
[07:01:53] someish: has joined #RubyOnRails
[07:01:55] defsdoor: has joined #RubyOnRails
[07:03:53] okraits: has joined #RubyOnRails
[07:13:32] dionysus69: has joined #RubyOnRails
[07:20:07] apeiros_: has joined #RubyOnRails
[07:28:29] conta: has joined #RubyOnRails
[07:31:33] easzero: has joined #RubyOnRails
[07:43:17] ur5us: has joined #RubyOnRails
[08:00:46] jfelchner: has joined #RubyOnRails
[08:18:49] Technodrome: has joined #RubyOnRails
[08:45:39] marr: has joined #RubyOnRails
[08:52:57] arBmind: has joined #RubyOnRails
[08:54:06] mikecmpbll: has joined #RubyOnRails
[08:56:11] alfiemax: has joined #RubyOnRails
[09:17:30] duderonomy: has joined #RubyOnRails
[09:19:37] daxroc: has joined #RubyOnRails
[09:21:13] _ritchie_: has joined #RubyOnRails
[09:23:57] alfiemax: has joined #RubyOnRails
[09:27:11] moei: has joined #RubyOnRails
[09:47:22] rikkipitt: has joined #RubyOnRails
[09:54:43] Doldge: has joined #RubyOnRails
[10:01:37] alfiemax: has joined #RubyOnRails
[10:09:06] pwnd_nsfw: has joined #RubyOnRails
[10:11:42] srinidhi: has joined #RubyOnRails
[10:30:34] srinidhi: has joined #RubyOnRails
[10:36:52] noob_on_rails: has joined #RubyOnRails
[10:39:11] ferr: has joined #RubyOnRails
[10:39:26] ferr: has left #RubyOnRails: ()
[10:44:47] _ritchie_: has joined #RubyOnRails
[10:52:12] alfiemax: has joined #RubyOnRails
[11:24:57] mr_foto: has joined #RubyOnRails
[11:47:07] Kutakizukari: has joined #RubyOnRails
[11:51:52] _ritchie_: has joined #RubyOnRails
[11:55:45] Kutakizukari: has joined #RubyOnRails
[12:05:17] mr-spoon: has joined #RubyOnRails
[12:12:13] kapil___: has joined #RubyOnRails
[12:13:00] drowze: has joined #RubyOnRails
[12:15:20] Technodrome: has joined #RubyOnRails
[12:16:04] alfiemax: has joined #RubyOnRails
[12:17:42] nickjj: has joined #RubyOnRails
[13:10:59] apparition: has joined #RubyOnRails
[13:22:38] tanuki: has joined #RubyOnRails
[13:31:31] dviola: has joined #RubyOnRails
[13:34:50] kristofferR: has joined #RubyOnRails
[13:35:46] pwnd_nsfw: has joined #RubyOnRails
[13:49:02] rgr: has joined #RubyOnRails
[14:00:43] Hosh: has joined #RubyOnRails
[14:03:25] iamarun: has joined #RubyOnRails
[14:07:55] Jameser: has joined #RubyOnRails
[14:13:03] someish: has joined #RubyOnRails
[14:23:26] ornerymoose: has joined #RubyOnRails
[14:26:25] safetypin: has joined #RubyOnRails
[14:26:57] ornerymoose_: has joined #RubyOnRails
[14:42:56] apeiros_: has joined #RubyOnRails
[14:50:43] quazimodo: has joined #RubyOnRails
[14:59:15] apparition: has joined #RubyOnRails
[15:05:30] fryguy: has joined #RubyOnRails
[15:11:11] Serpico194: has joined #RubyOnRails
[15:12:51] Serpico194: hi guys, if anyone has a few minutes i need help with a problem related to ActionMailer
[15:13:44] Serpico194: in short, I'm using an external SMTP server. It's properly configured, since I can send emails just fine using deliver_now in the console
[15:14:18] Serpico194: but when I try to run the same exact code in a model or controller, emails are not sent, throwing a "Permission denied" error
[15:15:27] Serpico194: I have NO idea how to tackle this issue honestly..
[15:33:25] Technodrome: has joined #RubyOnRails
[15:35:29] helpa: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[15:46:14] workmad3: has joined #RubyOnRails
[15:47:21] alexday: has left #RubyOnRails: ("WeeChat 1.9.1")
[15:48:11] clair13: has joined #RubyOnRails
[15:49:15] Puffball: has joined #RubyOnRails
[15:49:31] clair13: Has anyone encountered when creating a record duplication?
[15:50:10] clair13: But that is not the strange part,the strange is that one record is duplicated and the next one not
[15:50:19] dminuoso: clair13: !rule3
[15:50:19] helpa: clair13: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[15:56:24] mikecmpb_: has joined #RubyOnRails
[15:56:25] walidvb: has joined #RubyOnRails
[16:00:00] walidvb: i have an issue with ruby, actually. I have a parent ApplicationMailer class from which my mailers inherit. That class has a method that adds headers automatically. Sometimes i want to override these headers from a Mailer.
[16:00:56] walidvb: i add some instance variables on initialize, which are called in that method. It seems that calling the method from a child skips the initialize part of the parent, which i can't explain to myself
[16:01:01] walidvb: code is here: https://gist.github.com/walidvb/f5a37d08d023d5bb2e6682600de1415a
[16:01:45] walidvb: if i remove the call to add_sendgrid_headers from GenericMailer, then 1) it works 2) i see the output of ApplicationMailer#initialize
[16:02:30] moei: has joined #RubyOnRails
[16:03:58] hgost: has joined #RubyOnRails
[16:05:31] orbyt_: has joined #RubyOnRails
[16:08:07] Exhiled: has joined #RubyOnRails
[16:10:14] guacamole: has joined #RubyOnRails
[16:19:50] mikecmpbll: has joined #RubyOnRails
[16:20:04] centrx: has joined #RubyOnRails
[16:21:32] troys: has joined #RubyOnRails
[16:26:50] apeiros: has joined #RubyOnRails
[16:29:51] syndikate: Is there way I can protect a mounter url using omniauth ( and no devise? )
[16:36:38] drowze: has joined #RubyOnRails
[16:47:06] ur5us: has joined #RubyOnRails
[16:50:43] guacamole: has joined #RubyOnRails
[16:52:35] drowze: has joined #RubyOnRails
[16:57:16] guacamole: has joined #RubyOnRails
[16:59:58] chouhoulis: has joined #RubyOnRails
[17:00:23] cagomez: has joined #RubyOnRails
[17:01:27] safetypin: has joined #RubyOnRails
[17:01:30] mikecmpb_: has joined #RubyOnRails
[17:01:32] guacamole: has joined #RubyOnRails
[17:03:44] cagomez: has joined #RubyOnRails
[17:03:55] guacamole: has joined #RubyOnRails
[17:12:53] one_zero: has joined #RubyOnRails
[17:20:21] cagomez: has joined #RubyOnRails
[17:20:30] iamarun: has joined #RubyOnRails
[17:23:26] DTZUZO: has joined #RubyOnRails
[17:24:11] ornerymoose: has joined #RubyOnRails
[17:25:01] lacour: has joined #RubyOnRails
[17:27:08] cagomez: has joined #RubyOnRails
[17:27:11] irishfromua: has joined #RubyOnRails
[17:39:23] someish: has joined #RubyOnRails
[17:39:37] conta1: has joined #RubyOnRails
[17:45:03] blackmesa: has joined #RubyOnRails
[17:47:55] guacamole: has joined #RubyOnRails
[17:48:32] orbyt_: has joined #RubyOnRails
[17:50:01] Technodrome: has joined #RubyOnRails
[18:06:11] hahuang65: has joined #RubyOnRails
[18:07:34] Saukk: has joined #RubyOnRails
[18:10:26] mikecmpbll: has joined #RubyOnRails
[18:15:11] blackmesa: has joined #RubyOnRails
[18:15:33] Cache_Money: has joined #RubyOnRails
[18:17:28] guacamole: has joined #RubyOnRails
[18:25:09] Dimik: has joined #RubyOnRails
[18:25:55] Puffball: has joined #RubyOnRails
[18:28:20] mostlybadfly: has joined #RubyOnRails
[18:30:07] someish: has joined #RubyOnRails
[18:35:15] guacamole: has joined #RubyOnRails
[18:40:04] fragamus: has joined #RubyOnRails
[18:40:49] kapil___: has joined #RubyOnRails
[18:46:01] urk187: has joined #RubyOnRails
[19:01:58] sagax: has joined #RubyOnRails
[19:05:19] arBmind: has joined #RubyOnRails
[19:07:14] sonOfRa: has joined #RubyOnRails
[19:16:40] allcentury: has joined #RubyOnRails
[19:18:18] allcentury: Last night one thread running a long task started spitting out 'PG::UnableToSend: no connection to the server'. I'm a little surprised the AR connection pool kept this connection open - in the future, is there a better way to reset connections if this occurs? I could rescue and do it manually but I can't be the first person to try and do this
[19:25:00] Technodrome: has joined #RubyOnRails
[19:27:15] roshanavand: has joined #RubyOnRails
[19:29:52] jottr: has joined #RubyOnRails
[19:33:47] orbyt_: has joined #RubyOnRails
[19:40:00] LateralOctober: has joined #RubyOnRails
[19:45:17] alexday: has joined #RubyOnRails
[19:47:23] dionysus69: has joined #RubyOnRails
[19:48:25] greengriminal: has joined #RubyOnRails
[19:50:32] mtkd: has joined #RubyOnRails
[20:08:56] memo1: has joined #RubyOnRails
[20:10:39] memo1: question. I have a rails app on heroku. Im using the airbrake addon. I need to chante the Airbrake id and project id. In config/initializer/aribrake.rb is the id masked with a ENV varible. Whre i find the vairbles?
[20:16:07] cagomez: has joined #RubyOnRails
[20:17:23] someish: has joined #RubyOnRails
[20:19:05] mello: has joined #RubyOnRails
[20:19:45] mello: evening guys/gals hows it going, anyone here has any experience with Htt
[20:20:02] mello: httparty* gem
[20:20:48] mello: im tryin to do a post with token based authentication but im having a hard time figuring out how to do it with httparty
[20:32:19] jtperreault: memo1: I'm pretty sure you can find that in heroku under the app's settings, open the config vars
[20:41:19] ur5us: has joined #RubyOnRails
[20:45:04] orbyt_: has joined #RubyOnRails
[20:50:57] ur5us: has joined #RubyOnRails
[20:51:02] memo1: jtperreault: thank you. In the rails tree(console) is not possible?
[20:54:18] jtperreault: memo1: Not sure if you can from a rails console, check this for help perhaps? https://devcenter.heroku.com/articles/config-vars#setting-up-config-vars-for-a-deployed-application
[21:04:17] ^mtkd: has joined #RubyOnRails
[21:07:56] kies: has joined #RubyOnRails
[21:08:08] memo1: jtperreault: thank you
[21:16:27] nachoman: has joined #RubyOnRails
[21:17:53] nachoman: there is a recommended way to have a full and api application in a single project?
[21:21:33] alfie: nachoman: respond_to
[21:22:35] alfie: nachoman: in your respond_to blocks, you can `format.json { render json: @whatever }` and it'll spit out JSON instead of HTML
[21:23:12] dviola: has joined #RubyOnRails
[21:23:32] alfie: nachoman: although, i'd recommend you do it properly and separate out your API into an application with it's own controllers/etc, so you can version it properly
[21:23:58] nachoman: what about parameters for the api? how can I simplify them?
[21:25:24] fragamus: has joined #RubyOnRails
[21:26:07] nachoman: I had a problem with parameters in which I had to pass those using a strange format like entiry[parameter] as the name, can be simplified?
[21:27:11] nachoman: like parameter=value?
[21:28:43] alfie: nachoman: in what context?
[21:29:06] quazimodo: has joined #RubyOnRails
[21:33:26] nachoman: I was trying to create a new object using the default scaffold restful method (create) like POST /posts with data: title=asdasd body=asdasd and I wasn't able to do that because of the sanitizer, do you have any reference in how to setup parameters in this case?
[21:33:30] memo1: has joined #RubyOnRails
[21:34:14] nachoman: I was only able to create the object when i used parameters like posts[title] posts[body]
[21:49:52] workmad3: has joined #RubyOnRails
[21:59:18] cagomez: has joined #RubyOnRails
[22:01:55] roshanavand: has joined #RubyOnRails
[22:06:31] guacamole: has joined #RubyOnRails
[22:10:09] underport: has joined #RubyOnRails
[22:11:32] FCser: has left #RubyOnRails: ()
[22:28:41] orbyt_: has joined #RubyOnRails
[22:29:00] milesmatthias: has joined #RubyOnRails
[22:36:28] tfitts: I have need to allow complex queries across several models/relationships. I'm wondering if there is a good pattern to follow so I don't have 50 lines of setting up query code in my controller.
[22:40:34] nachoman: @tfitts: maybe using scopes http://guides.rubyonrails.org/active_record_querying.html#scopes
[22:40:35] ornerymoose: has joined #RubyOnRails
[22:44:56] NoGodDamnIdea: has joined #RubyOnRails
[22:45:57] nachoman: thank you alfie, your advice make me realize that I was reasoning wrong about the api
[22:48:16] FCser: has joined #RubyOnRails
[22:48:35] dblessing: has joined #RubyOnRails
[22:48:39] mostlybadfly: has joined #RubyOnRails
[23:05:49] orbyt_: has joined #RubyOnRails
[23:14:03] _ritchie_: has joined #RubyOnRails
[23:26:23] Radar: tfitts: It might be easier to show us smelly code and then for us to suggest a cleanup.
[23:27:22] tfitts: ok, I haven't written it in this app yet because I'm trying to prevent it. I'll see if I can grab some from a similar app I've worked on.
[23:31:08] tfitts: https://gist.github.com/tfitts/08f37765fc8735410dfab24701e76651
[23:32:34] baweaver: Scopes are your best friend
[23:32:52] baweaver: http://baweaver.com/blog/2015/05/04/sublime-scoping-with-rails/
[23:33:03] baweaver: Shameless self plug :D
[23:33:17] baweaver: oh wow that was 2 years ago wasn't it? Huh, how about that.
[23:33:53] baweaver: Never fixed that start..end bit though, considering end is a keyword XD
[23:34:36] tfitts: alright, I'll look into using more scopes.
[23:43:06] ornerymoose: has joined #RubyOnRails
[23:46:03] orbyt_: has joined #RubyOnRails
[23:50:02] workmad3: has joined #RubyOnRails
[23:50:08] greengriminal: has joined #RubyOnRails