« Back to channel list

#RubyOnRails - 14 August 2019

« Back 1 day Forward 1 day »
[00:10:21] havenwood: morenoh149: ask away!
[00:10:34] havenwood: morenoh149: or in Ruby, if not Rails-related at all
[00:11:29] skryking: has joined #RubyOnRails
[00:14:45] havenwood: #ruby, I mean
[00:30:43] regedit: why is this error: NoMethodError - undefined method `sanitize_sql_like'
[00:31:05] regedit: within an activerecord::base model class
[00:31:49] regedit: apparently it should exist? https://apidock.com/rails/v4.2.1/ActiveRecord/Sanitization/ClassMethods/sanitize_sql_like
[00:48:27] RiPuk: has joined #RubyOnRails
[01:41:10] ElFerna: has joined #RubyOnRails
[02:17:43] duderonomy: has joined #RubyOnRails
[02:21:44] duderonomy: has joined #RubyOnRails
[02:55:51] DTZUZO: has joined #RubyOnRails
[03:09:12] glasz: has joined #RubyOnRails
[03:22:22] Saukk: has joined #RubyOnRails
[03:29:51] duderonomy: has joined #RubyOnRails
[03:48:40] duderonomy: has joined #RubyOnRails
[04:37:32] tgreena: has joined #RubyOnRails
[04:43:58] lalitmee: has joined #RubyOnRails
[04:44:21] tgreena: has joined #RubyOnRails
[04:56:48] srinidhi: has joined #RubyOnRails
[04:57:02] Dbugger: has joined #RubyOnRails
[05:08:56] tsujp: has joined #RubyOnRails
[05:15:44] tsujp: has joined #RubyOnRails
[05:17:37] srinidhi: has joined #RubyOnRails
[05:18:14] lankanmon: has joined #RubyOnRails
[05:32:48] duderonomy: has joined #RubyOnRails
[05:49:11] Aherin: has joined #RubyOnRails
[06:06:14] alxgsv: has joined #RubyOnRails
[06:12:01] deepredsky: has joined #RubyOnRails
[06:40:24] deepredsky: has joined #RubyOnRails
[06:44:21] noodle: has joined #RubyOnRails
[06:48:53] lxsameer: has joined #RubyOnRails
[06:58:21] deepredsky: has joined #RubyOnRails
[07:00:43] alxgsv: has joined #RubyOnRails
[07:13:08] planigan: has joined #RubyOnRails
[07:15:11] alxgsv: has joined #RubyOnRails
[07:27:02] morenoh149: has joined #RubyOnRails
[07:35:36] quazimodo: has joined #RubyOnRails
[08:00:16] ariedler: has joined #RubyOnRails
[08:03:20] lalitmee: has joined #RubyOnRails
[08:03:56] deepredsky: has joined #RubyOnRails
[08:37:35] corellian: has joined #RubyOnRails
[08:39:39] Ergo: has joined #RubyOnRails
[08:58:04] uks: has joined #RubyOnRails
[09:00:15] deepredsky: has joined #RubyOnRails
[09:04:16] tsujp: has joined #RubyOnRails
[09:04:21] DTZUZO: has joined #RubyOnRails
[09:14:01] tsujp: has joined #RubyOnRails
[09:34:04] MrCrackPot: has joined #RubyOnRails
[09:41:37] morenoh149: has joined #RubyOnRails
[09:52:12] mlt-: has joined #RubyOnRails
[10:01:10] ariedler: has joined #RubyOnRails
[10:35:45] morenoh149: has joined #RubyOnRails
[10:39:28] gregf_: has joined #RubyOnRails
[10:55:08] ariedler: has joined #RubyOnRails
[11:11:59] ElFerna: has joined #RubyOnRails
[11:29:54] morenoh149: has joined #RubyOnRails
[11:31:07] cgfbee: has joined #RubyOnRails
[11:48:02] tsujp: has joined #RubyOnRails
[11:50:06] DTZUZO: has joined #RubyOnRails
[12:11:06] tsujp: has joined #RubyOnRails
[12:17:05] tsujp_: has joined #RubyOnRails
[12:24:01] morenoh149: has joined #RubyOnRails
[12:31:01] deepredsky: has joined #RubyOnRails
[12:37:43] srinidhi: has joined #RubyOnRails
[12:47:45] pavelz: if anyone dealth with mock verification/validation can someone give me a list of words to look for I am at a loss trying to validate for example included gem to make sure that for example that certain types of requests still work. for example - http.requst("host.com", "DELETE") - imaginary request might stop working , while this should be wrapped in a different class that is tested. I wonder if I mock
[12:47:51] pavelz: http.request - is there programmatic way to validate that "DELETE" is present for this code ? so that it is safe to use mocks down the road /
[12:53:31] tsujp: has joined #RubyOnRails
[13:18:10] morenoh149: has joined #RubyOnRails
[13:27:19] uksio: has joined #RubyOnRails
[13:49:43] deepredsky: has joined #RubyOnRails
[13:56:00] ElFerna: has joined #RubyOnRails
[13:58:46] tsujp: has joined #RubyOnRails
[14:12:18] morenoh149: has joined #RubyOnRails
[14:25:28] mgab: has joined #RubyOnRails
[14:31:29] mgab: Is using a boolean flag in a database to determine which relationship to transcend considered bad design? I am struggling to see some logic that some members of my team are describing. For example we have three models, Client, Organization and Person. The client_id is stored on the Organization or Person and a boolean is set on Client so that wh
[14:31:29] mgab: en true, look at Organization -- else, look at Person. Just curious how others would handle it.
[14:33:17] mgab: To me, we limit our customer types. To them, we will only have two types. But we've already somewhere decided that we might have more than two by carrying the client_id on them, easy to introduce a third.
[14:50:11] lalitmee: has joined #RubyOnRails
[15:00:11] Technodrome: has joined #RubyOnRails
[15:06:23] morenoh149: has joined #RubyOnRails
[15:14:26] jscheel: has joined #RubyOnRails
[15:24:44] Saukk: has joined #RubyOnRails
[15:33:37] deepredsky: has joined #RubyOnRails
[15:38:48] deepreds1: has joined #RubyOnRails
[15:43:16] tdy: has joined #RubyOnRails
[16:00:33] morenoh149: has joined #RubyOnRails
[16:17:11] deepreds1: has joined #RubyOnRails
[16:33:26] srinidhi: has joined #RubyOnRails
[16:38:43] tgreena: has joined #RubyOnRails
[16:41:01] ElFerna: has joined #RubyOnRails
[16:46:16] duderonomy: has joined #RubyOnRails
[16:48:42] herbst: has joined #RubyOnRails
[16:51:33] herbst: Hey there! Can anyone possibly help me with a puma issue i face? I am trying to implement phased-restart. However everytime i run the command from my git hook (same user tho) i end up with 502 Bad Gateway and the following in my log: *75 connect() to unix:///.../puma.sock failed (111: Connection refused) while connecting to upstream
[16:54:14] deepredsky: has joined #RubyOnRails
[16:54:41] morenoh149: has joined #RubyOnRails
[16:56:38] ravenous_: has joined #RubyOnRails
[17:08:00] herbst: dont mind me. I just pushed over my pid directory... :3
[17:08:06] herbst: have a nice day anyone!
[17:08:23] Linell: havenwood: lol you too! Glad you figured it out!
[17:11:52] spango: has joined #RubyOnRails
[17:37:25] sameerynho: has joined #RubyOnRails
[17:48:50] morenoh149: has joined #RubyOnRails
[18:11:28] NL3limin4t0r: Too bad mgab is already gone it sounds like he's looking for polymorphic associations.
[18:23:49] Linell: heh just noticed I mentioned the wrong person earlier, oops
[18:24:22] havenwood: Linell: It took me embarrassingly long to realize.
[18:24:29] havenwood: Linell: I thought I'd sleep chatted.
[18:24:38] Linell: hahaha sry about that
[18:24:49] havenwood: I was thinking, "What did I figure out? Guess I'm glad I solved it?" Haha.
[18:42:56] morenoh149: has joined #RubyOnRails
[19:01:09] ElFerna: has joined #RubyOnRails
[19:07:40] Technodrome: has joined #RubyOnRails
[19:15:57] tdy: has joined #RubyOnRails
[19:23:31] regedit: has joined #RubyOnRails
[19:24:52] regedit: is it possible to complete the HTTP response, flush, close connection on the client, while still finishing up a bit of work server side?
[19:26:26] regedit: i know in PHP for example you can do ignore_user_abort() and flush() and stuff like that and then continue some post-processing after that without keeping the client waiting
[19:27:49] _aeris_: has joined #RubyOnRails
[19:31:49] ElFerna: has joined #RubyOnRails
[19:36:12] morenoh149: has joined #RubyOnRails
[19:37:34] havenwood: regedit: Yes, you can do that in Ruby in a variety of ways.
[19:39:32] havenwood: regedit: Streaming is super easy in Rails: https://api.rubyonrails.org/classes/ActionController/Streaming.html
[19:40:14] regedit: havenwood: how do i find all these nice "rubyonrails" docs for rails 4?
[19:41:18] regedit: "api.rubyonrails.org" docs that is
[19:43:36] havenwood: regedit: regedit
[19:43:38] havenwood: regedit: https://guides.rubyonrails.org/v4.2/
[19:43:39] lato_1: has joined #RubyOnRails
[19:44:15] havenwood: regedit: Streaming uses a Fiber under the hood.
[19:44:33] havenwood: regedit: Another option is to use ActionCable. Here's an example: https://blog.jakewilkins.com/2017/08/25/building-something-besides-a-chat-app-with-actioncable/
[19:44:53] regedit: so is it really streaming what i'm trying to do?
[19:44:59] regedit: my use case is basically;
[19:46:06] regedit: upload a 19.2 MB file, takes relatively no time, then server side store the file via carrierwave+fog to S3, but for whatever reason that stretches the request time out to about 20 sec!...
[19:46:45] havenwood: regedit: My friend and girlfriend had basically that same issue and wrote the article above about solving it with ActionCable.
[19:46:50] regedit: so i was hoping i can tell the browser "kthxbai" after the upload is complete, then continue with transfer to S3 after the client is done with the request
[19:47:18] havenwood: regedit: "My basic task was to allow a user to request a PDF which would be generated asynchronously and notify them when it was ready."
[19:47:44] regedit: girlfriend having issues with rails upload request time? where do i find such girlfriends please
[19:48:21] havenwood: regedit: I met her at RubyConf then again at Ruby in Hollywood, which she founded. ¯\_(ツ)_/¯
[19:49:04] Linell: regedit: another way is to use something like Sidekiq to do the actual uploading
[19:49:14] havenwood: Linell: That's what the ActionCable example does.
[19:49:28] havenwood: Linell: But on Heroku, and similar setups, there's a timeout after about 20 seconds.
[19:49:28] Linell: oh nice, oops
[19:49:46] regedit: Linell: that's the thing tho... on heroku the uploaded file is ephemeral, i can only do something with it within the request time
[19:49:58] havenwood: regedit: Heroku filesystem isn't as ephemeral anymore.
[19:50:26] havenwood: Oh, nevermind.
[19:50:45] regedit: is it really not tho? i even tried exploring that possibilitiy and tried some tests, so far couldnt ever find the file on subsequent dyno processes...
[19:51:02] havenwood: They still might cycle daily, so effectively it's still ephemeral.
[19:51:22] havenwood: regedit: Are you using the latest dyno version?
[19:51:30] regedit: ah probably not...
[19:51:35] havenwood: regedit: Not that I would rely on the FS, with the daily cycle.
[19:51:35] regedit: how can i tell?
[19:52:02] regedit: i don't mind in this case. this file upload is used rather rarely, if it fails the users dont care to just retry
[19:52:34] havenwood: regedit: They call it the "Stack"
[19:52:48] havenwood: regedit: Under the GUI, you can go to "Settings" and "Upgrade Stack"
[19:52:59] havenwood: regedit: https://devcenter.heroku.com/articles/stack
[19:53:07] regedit: i tested uploading a file and writing it to Rails.root/public/tmp/something.wtvr , then try opening that file from Sidekiq. Always gets file not found
[19:53:22] havenwood: regedit: Are you using Active Storage
[19:53:32] havenwood: regedit: https://edgeguides.rubyonrails.org/active_storage_overview.html
[19:53:47] havenwood: Oops, didn't mean to link edge.
[19:53:47] havenwood: https://guides.rubyonrails.org/active_storage_overview.html
[19:53:57] regedit: is active storage also a thing on rails 4?
[19:54:14] havenwood: regedit: It doesn't ship with Rails 4, but I've used it and it works.
[19:54:22] havenwood: regedit: You can just add it to Rails 4.
[19:54:40] havenwood: regedit: https://github.com/sdtechdev/activestorage-rails4
[19:55:05] havenwood: regedit: Actually, I think it was an earlier version of Rails 5 I used it with. I'm having a doubt now about 4.
[19:55:29] havenwood: regedit: My memory fails me. I remember using it with a previous Rails release. Now I'm thinking that was just an earlier Rails 5, but unsure.
[19:55:40] s00pcan: has joined #RubyOnRails
[19:55:48] havenwood: regedit: I'd suggest using it if you can!
[19:56:17] regedit: i see the stack is currently heroku-16, is that more ephemeral FS than upgraded stack?
[19:57:40] morenoh149: has joined #RubyOnRails
[19:59:54] HumorBaby: has joined #RubyOnRails
[20:02:25] havenwood: regedit: I'd check stack release notes.
[20:03:21] HumorBaby: has joined #RubyOnRails
[20:03:51] s00pcan: has joined #RubyOnRails
[20:03:52] deepreds1: has joined #RubyOnRails
[20:04:20] regedit: can't seem to find any particular such release notes... https://devcenter.heroku.com/articles/heroku-18-stack
[20:08:53] LtHummus: has joined #RubyOnRails
[20:09:30] HumorBaby: has joined #RubyOnRails
[20:47:34] za1b1tsu: has joined #RubyOnRails
[20:56:37] morenoh149: has joined #RubyOnRails
[21:53:30] za1b1tsu: has joined #RubyOnRails
[22:09:23] mochiyoda: has joined #RubyOnRails
[22:39:48] drale2k_: has joined #RubyOnRails
[22:40:01] drale2k_: with STI, does it matter if you out a "has_many" or "has_one" relation on the parent or child?
[22:40:05] drale2k_: or is there a rule?
[23:07:50] morenoh149: has joined #RubyOnRails
[23:15:06] ElFerna: has joined #RubyOnRails
[23:21:27] s00pcan: has joined #RubyOnRails
[23:26:02] morenoh149: has joined #RubyOnRails
[23:27:49] psmolen: has joined #RubyOnRails
[23:33:56] mlt-: Is there a way to use PostgrSQL IDENTITY with Rails fixtures?