#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: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: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:36:02] Radar: And really http://guides.rubyonrails.org/maintenance_policy.html should say / indicate that 4.2 is NO LONGER SUPPORTED. Hooray
[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']['images'] or @output['products']['images'] it returns https://i5.walmartimages.com/asr/8db293c3-165e-4d4c-85bd-0d07390211f1_1.4f4822a5adfdb0ade9491a1a4db775e9.jpeg
[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
[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?
[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?
[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:30:16] sonOfRa: http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-5-1-to-rails-5-2
[12:48:00] dminuoso: sevenseacat: Do you know whether paper_trail should serialize enums into the string/symbol representation for the object/object_changes?
[13:13:52] dminuoso: crst: If you prefer minitest that's great. If you prefer rspec that's great too.
[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: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
[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:50:22] op84: sylario: why not? this method works - just thought maybe there’s a much better way to do that
[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
[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:20:19] rikkipitt: hey folks, has anyone here tried dropzone.js with active storage/direct uploads?
[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
[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: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: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: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
[17:01:39] et09: getting 422's with an apparently vavlid token i grabbed from <%= hidden_field_tag :authenticity_token, form_authenticity_token - %>
[17:15:38] dipnlik: kurko_: `Model.select(:an_attribute).find_by(conditions)` does what I wanted, thanks for pointing me in the right direction!
[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: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: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 :(
[21:25:13] atchoum: I am concerned about mixed view with applicative code and I would prefer my front end totally static
[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: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