« Back to channel list

#RubyOnRails - 10 April 2018

« Back 1 day Forward 1 day »
[00:03:16] erdave: Hello, I've been trying to integrate the devise gem in my project without success. It tells me to install the 'execjs' gem to the system, but it didn't work neither (drops the same error message). Here's a screenshot https://i.imgur.com/gC1YcpK.jpg
[00:05:08] Disavowed: erdave: You'll want a JS runtime. You can pick one from here: https://github.com/rails/execjs
[00:05:13] Disavowed: Lot of folks like node
[00:05:31] dviola: has joined #RubyOnRails
[00:06:06] easzero: has joined #RubyOnRails
[00:11:24] erdave: Disavowed: :O so I only had to install nodejs? Damn, I suck xD I thought the execjs gem provided it...
[00:12:34] Disavowed: erdave: Ah! It's not a ruby gem remember - it's a runtime. But yeah that should get you there!
[00:12:55] Disavowed: Achievement Unlocked: my first useful channel contribution!
[00:16:10] erdave: hahahaha cool dude, thanx!
[00:16:40] Disavowed: You're most welcome mate
[00:20:27] workmad3: has joined #RubyOnRails
[00:21:10] cagomez: has joined #RubyOnRails
[00:23:06] rfoust: has joined #RubyOnRails
[00:25:13] _3dwardsharp: has joined #RubyOnRails
[00:25:26] caoraivoso: has joined #RubyOnRails
[00:28:04] Radar: omg the topic is out of date who is in charge here and why are they so lazy
[00:29:35] Radar: Rules: http://goo.gl/dgSj5 | MINASWAN (Matz is nice and so we are nice) | Can't talk? Register/identify with Nickserv first! | Newest releases: 5.2.5, 5.0.7, 4.2.10 | Rails 5.2 Blog Announcement: http://bit.ly/rails-52 | Guides: http://goo.gl/Drh96 | API Docs: http://goo.gl/ErSVb | Mailing List: http://is.gd/3Euc | Book List: http://goo.gl/SGklzh | Logs at http://goo.gl/uma9x
[00:30:12] Radar: hm no that isn't right either
[00:36:02] Radar: And really http://guides.rubyonrails.org/maintenance_policy.html should say / indicate that 4.2 is NO LONGER SUPPORTED. Hooray
[00:38:04] orbyt_: has joined #RubyOnRails
[00:47:49] duderonomy: has joined #RubyOnRails
[00:52:57] LateralOctober: has joined #RubyOnRails
[01:08:29] rafaeldelucena: has joined #RubyOnRails
[01:12:06] cstls: has joined #RubyOnRails
[01:47:15] s2013: has joined #RubyOnRails
[02:14:27] shtirlic: has joined #RubyOnRails
[02:19:53] workmad3: has joined #RubyOnRails
[02:43:15] Saukk: has joined #RubyOnRails
[02:49:50] eckhardt: has joined #RubyOnRails
[02:52:32] darkhanb: has joined #RubyOnRails
[02:53:28] LateralO1: has joined #RubyOnRails
[03:09:04] KeyJoo: has joined #RubyOnRails
[03:11:05] MrCrackPotBuilde: hhhmmm i figured out why i cant add an image tag using the output its because inside the hash array for images is this "images"=>["https://i5.walmartimages.com/asr/8db293c3-165e-4d4c-85bd-0d07390211f1_1.4f4822a5adfdb0ade9491a1a4db775e9.jpeg"],
[03:12:29] MrCrackPotBuilde: so if i use @output['products'][0]['images'][0] or @output['products'][0]['images'] it returns https://i5.walmartimages.com/asr/8db293c3-165e-4d4c-85bd-0d07390211f1_1.4f4822a5adfdb0ade9491a1a4db775e9.jpeg
[03:12:52] sevenseacat: has joined #RubyOnRails
[03:13:10] MrCrackPotBuilde: imguessing somehow i need to convert the hash to a string then import the output value but how can i do this
[03:29:19] s2013: has joined #RubyOnRails
[03:36:38] jcarl43: has joined #RubyOnRails
[03:37:00] kapil___: has joined #RubyOnRails
[04:02:01] s2013: has joined #RubyOnRails
[04:19:18] workmad3: has joined #RubyOnRails
[04:46:38] harrycs: has joined #RubyOnRails
[05:01:15] reber: has joined #RubyOnRails
[05:05:34] LateralOctober: has joined #RubyOnRails
[05:06:29] apeiros: has joined #RubyOnRails
[05:34:54] DTZUZO: has joined #RubyOnRails
[05:40:25] cam27: has joined #RubyOnRails
[05:47:55] Puffball: has joined #RubyOnRails
[05:52:36] opekktar_: has joined #RubyOnRails
[06:18:49] workmad3: has joined #RubyOnRails
[06:38:43] Sylario: has joined #RubyOnRails
[06:41:32] tcopeland: has joined #RubyOnRails
[06:42:03] tdy: has joined #RubyOnRails
[06:42:07] srinidhi: has joined #RubyOnRails
[06:47:48] linetrace: has joined #RubyOnRails
[06:49:59] DrYockel: has joined #RubyOnRails
[07:06:14] LateralO1: has joined #RubyOnRails
[07:13:54] KeyJoo: has joined #RubyOnRails
[07:16:31] defsdoor: has joined #RubyOnRails
[07:17:50] kapil___: has joined #RubyOnRails
[07:19:04] dionysus69: has joined #RubyOnRails
[07:20:03] uks: has joined #RubyOnRails
[07:22:03] one_zero: has joined #RubyOnRails
[07:22:29] Ergo: has joined #RubyOnRails
[07:36:16] reber: has joined #RubyOnRails
[07:42:32] marr: has joined #RubyOnRails
[08:00:05] drale2k_: has joined #RubyOnRails
[08:01:48] drale2k_: has joined #RubyOnRails
[08:09:08] dminuoso: Thank you rails.
[08:09:11] dminuoso: wrong number of arguments (given 2, expected 1)
[08:09:15] dminuoso: def assoc_klass(name, options = {})
[08:09:33] dminuoso: Guess what the fix is: restarting spring.
[08:12:18] tbuehlmann: *cheeky comment here*
[08:18:11] workmad3: has joined #RubyOnRails
[08:44:45] mtkd: has joined #RubyOnRails
[08:50:02] KeyJoo: has joined #RubyOnRails
[08:53:52] srinidhi: has joined #RubyOnRails
[09:01:22] armyriad: has joined #RubyOnRails
[09:02:21] mikecmpbll: has joined #RubyOnRails
[09:06:47] LateralOctober: has joined #RubyOnRails
[09:23:44] srinidhi: has joined #RubyOnRails
[09:35:52] mikecmpbll: has joined #RubyOnRails
[10:03:24] workmad3: has joined #RubyOnRails
[10:09:35] jaffachief: has joined #RubyOnRails
[10:09:37] dminuoso: Perhaps someone here knows this from the top off their head. Does paper_trail have any API to populate object_changes if you add it onto an existing table?
[10:19:14] Voxxit: has joined #RubyOnRails
[10:25:58] drale2k_: has joined #RubyOnRails
[10:29:38] DaniG2k: has joined #RubyOnRails
[10:37:04] arBmind: has joined #RubyOnRails
[10:40:54] dviola: has joined #RubyOnRails
[10:42:02] ElFerna: has joined #RubyOnRails
[10:43:06] cstls: has joined #RubyOnRails
[10:53:05] Fernando-Basso: has joined #RubyOnRails
[10:53:45] apparition: has joined #RubyOnRails
[10:55:14] apeiros: has joined #RubyOnRails
[11:00:42] reber: has joined #RubyOnRails
[11:03:41] drale2k_: has joined #RubyOnRails
[11:03:42] mikecmpbll: has joined #RubyOnRails
[11:07:23] LateralO1: has joined #RubyOnRails
[11:15:35] Torrone: has joined #RubyOnRails
[11:15:38] Torrone: hello, I've added capistrano3-autoscaling-deploy to my capfile and now deploy fails at asset precompilation: it looks for a [release_path]/yarn.js and it doesn't find it, saying yarn is not installed, but it is, what can I do about this?
[11:24:07] Cavallari: has joined #RubyOnRails
[11:35:25] alfiemax: has joined #RubyOnRails
[11:42:05] KeyJoo: has joined #RubyOnRails
[11:47:55] mtkd: has joined #RubyOnRails
[11:50:24] sidx64: has joined #RubyOnRails
[12:00:30] srinidhi: has joined #RubyOnRails
[12:06:36] srinidhi: has joined #RubyOnRails
[12:10:28] kurko_: has joined #RubyOnRails
[12:14:17] merrion: has joined #RubyOnRails
[12:16:51] merrion: Sorry for being OT but I don't know where else to find Puma users. Has anyone ever experienced #<Puma::HttpParserError: Invalid HTTP format, parsing fails.> when the request query string contains quotes, e.g. /search?q="foo". IE is replacing the " with \x22 and our Nginx/Puma chokes on it.
[12:26:04] crst: has joined #RubyOnRails
[12:26:56] crst: Hi, is there anything one needs to be aware of when upgrading from 5.1.5 -> 5.2 ?
[12:28:29] crst: *anything special
[12:30:16] sonOfRa: http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-5-1-to-rails-5-2
[12:31:17] srinidhi: has joined #RubyOnRails
[12:37:51] sidx64_: has joined #RubyOnRails
[12:41:33] _aeris_: has joined #RubyOnRails
[12:46:32] sidx64: has joined #RubyOnRails
[12:48:00] dminuoso: sevenseacat: Do you know whether paper_trail should serialize enums into the string/symbol representation for the object/object_changes?
[12:48:19] dminuoso: ACTION wants to stop reflecting
[12:48:23] sevenseacat: I dont know off the top of my head. if I had to guess I'd say no
[12:51:00] crst: Is there a particular reason rspec is not included in "rails new" (v5.2 at least)?
[12:51:16] dminuoso: crst: rails ships with minitest by default
[12:51:41] sevenseacat: rails is opinionated and they dont like rspec so
[12:51:55] dminuoso: Rails opinionated? No.
[12:51:58] dminuoso: I dont believe that.
[12:53:27] crst: May I ask how you prefer testing?
[12:54:24] crst: that's a relief
[12:56:32] s2013: has joined #RubyOnRails
[13:01:40] drale2k_: has joined #RubyOnRails
[13:04:58] sidx64: has joined #RubyOnRails
[13:06:30] Voxxit: has joined #RubyOnRails
[13:13:42] dminuoso: crst: Honestly either is fine.
[13:13:52] dminuoso: crst: If you prefer minitest that's great. If you prefer rspec that's great too.
[13:14:05] dminuoso: Having adequate tests is the important bit, not what library you use.
[13:14:13] crst: dminuoso: I've never used minitest
[13:14:42] dminuoso: I've seen minitests, I dont like them but I dont have any actual arguments against it. I just prefer the rspec looks.
[13:15:01] crst: Also I'm, not much into rspec either, but I assigned writing tests in rspec recently.
[13:16:10] dminuoso: crst: Rspec is so good it convinced Haskellers to copy the whole idea. =)
[13:16:32] crst: Ah didn't know that, that's cool
[13:16:36] dminuoso: https://hspec.github.io/
[13:18:00] duderonomy: has joined #RubyOnRails
[13:29:39] Saukk: has joined #RubyOnRails
[13:29:57] sidx64: has joined #RubyOnRails
[13:35:06] rfoust: has joined #RubyOnRails
[13:40:50] alfiemax: has joined #RubyOnRails
[13:41:07] cschneid_: has joined #RubyOnRails
[13:41:11] op84: has joined #RubyOnRails
[13:44:46] justinweiss: has joined #RubyOnRails
[13:44:47] op84: hello! is there any better way to see if the new shop is a valid change without actually modifying / setting new value to the object? https://pastebin.com/KR9xA3mx
[13:48:27] srinidhi: has joined #RubyOnRails
[13:48:45] lipoqil: has joined #RubyOnRails
[13:51:37] LyndsySimon: has joined #RubyOnRails
[13:58:01] Kamuela: has joined #RubyOnRails
[14:01:37] mikecmpbll: has joined #RubyOnRails
[14:02:10] podman: has joined #RubyOnRails
[14:02:52] mmun: has joined #RubyOnRails
[14:03:30] mtkd: has joined #RubyOnRails
[14:05:17] DukeDave: has joined #RubyOnRails
[14:08:59] Mutsuhito: has joined #RubyOnRails
[14:12:20] dnyy: has joined #RubyOnRails
[14:12:42] ircmaxell: has joined #RubyOnRails
[14:12:50] drale2k_: has joined #RubyOnRails
[14:13:45] mattwc: has joined #RubyOnRails
[14:14:11] catbusters: has joined #RubyOnRails
[14:17:21] iamdevnul: has joined #RubyOnRails
[14:18:07] auv: has joined #RubyOnRails
[14:18:11] Lloyd: has joined #RubyOnRails
[14:21:06] tycoon177: has joined #RubyOnRails
[14:24:29] craysiii: has joined #RubyOnRails
[14:25:46] apeiros__: has joined #RubyOnRails
[14:29:30] maciuszek: has joined #RubyOnRails
[14:31:26] sidx64: has joined #RubyOnRails
[14:32:36] Nuck: has joined #RubyOnRails
[14:33:06] Sylario: op84 > you could call the validation in charge instead of usign valid?
[14:33:10] DrYockel1: has joined #RubyOnRails
[14:33:45] Sylario: *in charge of checking the shop
[14:34:04] mr-robert: has joined #RubyOnRails
[14:35:43] yoones: has joined #RubyOnRails
[14:38:23] op84: sylario: like how?
[14:39:03] Sylario: op84: > can you post the whole class around movable_to ?
[14:39:32] Sylario: you change shop, and run the validation
[14:40:57] Sylario: That mean somewhere in the model, there is validations, either it's a simple one and you duplicate it (no longer DRY, but this method is not that great) or it calls a method for validation and you just call the same method
[14:41:43] Sylario: wait, validation method just change the errors in the model, you have to extract the test itself in yet another method I think
[14:41:58] Cavallari1: has joined #RubyOnRails
[14:42:15] op84: sure sylario https://pastebin.com/E2AW9xzG
[14:42:50] DrYockel1: has joined #RubyOnRails
[14:43:37] op84: sylario: yeah i’m avoiding the extraction by reloading the initial values again
[14:45:33] SteenJobs: has joined #RubyOnRails
[14:47:15] Sylario: @op84 you can scrap the method, you can never move
[14:49:11] orbyt_: has joined #RubyOnRails
[14:50:22] op84: sylario: why not? this method works - just thought maybe there’s a much better way to do that
[14:52:18] cam27: has joined #RubyOnRails
[14:53:33] Sylario: op84: you have one award, so it is already unique. The test will never fail
[14:54:18] Sylario: but you will end up with a review linked to a shop while the award is linked to another
[14:56:24] op84: sylario: no there’s a scope on the shop… and i’m reassigning the shop… and then validate… so it may fail if the other shop already has a review on that specific award
[14:56:37] Sylario: ho wait, you are right
[14:57:00] Sylario: it validates there is no other review with the same shop and award
[14:57:39] apeiros: has joined #RubyOnRails
[14:58:00] Sylario: !Review.where(shop: shop,award: award).any?
[14:58:21] Sylario: this can replace your movable_to
[14:58:31] apeiros: has joined #RubyOnRails
[14:58:49] MrCrackPotBuilde: has joined #RubyOnRails
[15:00:48] Sylario: It's not perfect, but in a different way than yours
[15:01:22] op84: sylario: hehe yeah you are right - thanks a lot for your time!
[15:11:36] s2013: has joined #RubyOnRails
[15:13:41] kurko_: Am I the only one who thinks 5.2's credentials defaulting to loading production creds is a recipe for disaster?
[15:19:40] rikkipitt: has joined #RubyOnRails
[15:20:19] rikkipitt: hey folks, has anyone here tried dropzone.js with active storage/direct uploads?
[15:22:33] rikkipitt: has joined #RubyOnRails
[15:22:35] devlaf: has joined #RubyOnRails
[15:33:37] voker57: has joined #RubyOnRails
[15:33:39] alfiemax: has joined #RubyOnRails
[15:34:45] voker57: Is there a way to easily use SQL interpolation in .select? .select("smth > ?", 5) raises error, looks like it does not take hashes/arrays of arguments to interpolate
[15:41:54] harrycs: has joined #RubyOnRails
[15:42:23] cagomez: has joined #RubyOnRails
[16:01:17] mikecmpbll: has joined #RubyOnRails
[16:01:51] npgm: has joined #RubyOnRails
[16:03:09] jcarl43: has joined #RubyOnRails
[16:08:13] mr-robert: voker57: select takes a list of column names, your part of the query is for where() and it works as intended.
[16:09:10] voker57: mr-robert: it also can take SQL to select non-columns, and that's where I need interpolation
[16:09:44] voker57: my example might be misleading: it's rather like "smth + ?"
[16:11:27] darkhanb: has joined #RubyOnRails
[16:13:55] one_zero: has joined #RubyOnRails
[16:15:45] dionysus69: has joined #RubyOnRails
[16:17:25] elcms: has joined #RubyOnRails
[16:23:33] weird_error: has joined #RubyOnRails
[16:32:15] cagomez: I have a Receipt with Line Items (each with a Product). I have a transaction that saves a Receipt, and Products call `.touch` on their associated Line Item. If I obtain a lock on Receipt, I'm only locking that row, right? ie I'm not obtaining a lock on the associated Line Items and Products
[16:38:49] dipnlik: is there a better way to write `Model.where(conditions).pluck(:an_attribute).first` when `conditions` always point to a single record?
[16:39:16] SteenJobs: has joined #RubyOnRails
[16:44:32] unreal: has joined #RubyOnRails
[16:48:01] fryguy: Model.find_by(conditions)
[16:48:32] dipnlik: but that changes the SQL query
[16:49:20] fryguy: in a negative way?
[16:49:45] dipnlik: yes. pluck does select.an_attribute, find_by does select.*
[16:50:08] fryguy: and why is that problematic in your case?
[16:51:02] dipnlik: not sure. I know there's some big columns in this table, but didn't compare enough since I'm new to this project
[16:52:44] kapil___: has joined #RubyOnRails
[16:53:39] dipnlik: don't want an "aesthetic" code change to affect performance, that's why I want to keep the query the same if I proceed with the change
[16:54:05] darkhanb_: has joined #RubyOnRails
[17:00:55] et09: has joined #RubyOnRails
[17:01:04] et09: header for AJAX post is called X-XSRF-TOKEN, right?
[17:01:39] et09: getting 422's with an apparently vavlid token i grabbed from <%= hidden_field_tag :authenticity_token, form_authenticity_token - %>
[17:04:37] cstls: has joined #RubyOnRails
[17:05:22] et09: ah - X-CSRF-TOKEN
[17:07:29] kurko_: dipnlik can you do `Model.select(:an_attribute).find(id)`?
[17:12:37] elcms: has joined #RubyOnRails
[17:13:19] darkhanb: has joined #RubyOnRails
[17:15:38] dipnlik: kurko_: `Model.select(:an_attribute).find_by(conditions)` does what I wanted, thanks for pointing me in the right direction!
[17:17:24] Linuus: has joined #RubyOnRails
[17:21:00] kurko_: dipnlik anytime
[17:24:34] Linuus: has joined #RubyOnRails
[17:29:25] reber: has joined #RubyOnRails
[17:30:04] cagomez: has joined #RubyOnRails
[18:00:52] [Butch]: has joined #RubyOnRails
[18:08:30] srinidhi: has joined #RubyOnRails
[18:15:51] tdy: has joined #RubyOnRails
[18:19:56] sameerynho: has joined #RubyOnRails
[19:02:02] mtkd: has joined #RubyOnRails
[19:08:53] SteenJobs: has joined #RubyOnRails
[19:09:16] alfiemax: has joined #RubyOnRails
[19:16:53] iamdevnul: so weird issue i've run into, running db:migrate through cap in one of our environments takes an especially long time regardless of whether there any migrations to run. Jumping on the box locally and running it seems to run in a reasonable amount of time
[19:17:08] iamdevnul: this started after upgrading to rails 5.1
[19:17:26] iamdevnul: it's definitely doing something, CPU is being used
[19:25:16] uksio: has joined #RubyOnRails
[19:32:47] mtkd: has joined #RubyOnRails
[19:32:51] ellcs: has joined #RubyOnRails
[19:37:16] FrostCandy: has joined #RubyOnRails
[19:38:09] FrostCandy: I have redirect_to edit_org_url(@org), i want it to go to https:// though. When it redirects it only goes to http :(
[19:39:02] FrostCandy: I guess i cna use a full url
[19:40:37] ^mtkd: has joined #RubyOnRails
[19:48:34] ellcs: has joined #RubyOnRails
[19:51:54] AlHafoudh: guys, does anyone had this problem? when me and my colleagues run rspec using transactional fixtures, all tests pass. when I run the rspec in jenkins (same ruby version, runs inside docker container), it looks like rspec does not rollback the transactions between test cases and records are piling up :(
[19:53:44] sidx64: has joined #RubyOnRails
[20:01:05] alfiemax: has joined #RubyOnRails
[20:08:56] workmad3: has joined #RubyOnRails
[20:09:00] SteenJobs: has joined #RubyOnRails
[20:20:21] cagomez: has joined #RubyOnRails
[20:25:45] moei: has joined #RubyOnRails
[20:27:31] sidx64_: has joined #RubyOnRails
[20:31:51] sonOfRa: has joined #RubyOnRails
[20:33:11] cagomez: has joined #RubyOnRails
[20:34:11] harrycs: has joined #RubyOnRails
[20:34:58] hive-mind: has joined #RubyOnRails
[20:38:02] mikecmpbll: has joined #RubyOnRails
[20:39:03] alfiemax: has joined #RubyOnRails
[20:55:40] sidx64: has joined #RubyOnRails
[21:16:20] alfiemax: has joined #RubyOnRails
[21:17:18] elcms: has joined #RubyOnRails
[21:20:31] rikkipitt: has joined #RubyOnRails
[21:21:09] chouhoulis: has joined #RubyOnRails
[21:22:25] atchoum: has joined #RubyOnRails
[21:22:55] atchoum: I wanted to ask, because I am starting to write a rail app
[21:25:11] cjohnson: Anybody here using webpacker with https: false?
[21:25:13] atchoum: I am concerned about mixed view with applicative code and I would prefer my front end totally static
[21:25:17] atchoum: how would you do that ?
[21:35:12] sagax: has joined #RubyOnRails
[21:35:49] voker57: render file: 'public/index.html'
[21:37:07] Ergo: has joined #RubyOnRails
[21:38:15] jottr: has joined #RubyOnRails
[21:44:08] atchoum: voker57: is there some way to do this easily with rail ?
[21:45:48] voker57: atchoum: is one line in controller not easy enough?
[21:46:35] voker57: also I'm not sure I understand what do you mean by totally static frontend
[21:49:03] atchoum: voker57: I want to write an API + a front-end in pure JS/React
[21:51:01] voker57: api will be in rails? what should be static then? starting page?
[21:51:48] voker57: and what exactly are you concerned with that is related to rails?
[22:17:52] cagomez: has joined #RubyOnRails
[22:20:57] ur5us: has joined #RubyOnRails
[22:25:21] rfoust: has joined #RubyOnRails
[22:33:31] LateralOctober: has joined #RubyOnRails
[22:37:17] s2013: has joined #RubyOnRails
[22:40:31] darkhanb: Has any used Hammerspace for I18n::Backend::KeyValue backend?
[22:52:59] snc123: has joined #RubyOnRails
[22:59:20] marr: has joined #RubyOnRails
[23:20:23] weaksauce: has joined #RubyOnRails
[23:20:49] greengriminal: has joined #RubyOnRails
[23:20:57] Radar: GOOD MORNING
[23:29:04] orbyt_: has joined #RubyOnRails
[23:45:21] emers2n: has joined #RubyOnRails
[23:46:06] emers2n: Hey all... Got a pretty simple Rails question. If I want to define a function that I need to be able to call from 2 different controllers, where should I define said function?
[23:46:51] Radar: emers2n: Normally people chuck that into ApplicationController, or make a module that defines the function and then include that module in both controllers.
[23:48:02] emers2n: Radar: Awesome, Ty!
[23:49:31] greengriminal: has joined #RubyOnRails
[23:52:07] apparition: has joined #RubyOnRails
[23:54:40] snc123: I'm looking to build a Rails backend and React Native mobile app, haven't played with Rails in a long time.. just finished Michael
[23:54:49] snc123: Hart's book.. any idea of where to go next
[23:55:47] emers2n: Start coding
[23:57:25] weaksauce: has joined #RubyOnRails