« Back to channel list

#RubyOnRails - 14 March 2019

« Back 1 day Forward 1 day »
[00:01:36] jaddison: has joined #RubyOnRails
[00:06:15] ebsen: has joined #RubyOnRails
[00:06:52] ebsen: has joined #RubyOnRails
[00:12:33] duderonomy: has joined #RubyOnRails
[00:13:17] rascencio: has joined #RubyOnRails
[00:18:56] thebrianguy: has joined #RubyOnRails
[00:34:06] MrCrackPotBuilde: has joined #RubyOnRails
[00:46:19] orbyt_: has joined #RubyOnRails
[01:30:30] unreal: has joined #RubyOnRails
[01:56:18] rascencio: has joined #RubyOnRails
[02:14:36] creature: has joined #RubyOnRails
[02:24:04] FernandoBasso: has joined #RubyOnRails
[02:44:16] sevenseacat: has joined #RubyOnRails
[03:11:24] TvL2386: has joined #RubyOnRails
[03:18:19] DTZUZO: has joined #RubyOnRails
[03:24:26] Saukk: has joined #RubyOnRails
[04:03:51] eckhardt: has joined #RubyOnRails
[04:05:57] maryo: has joined #RubyOnRails
[04:10:43] braincrash: has joined #RubyOnRails
[04:13:32] cam27: has joined #RubyOnRails
[04:37:36] MrCrackPot: has joined #RubyOnRails
[05:01:20] tdy1: has joined #RubyOnRails
[05:07:19] Technodrome: has joined #RubyOnRails
[05:07:33] quazimodo: has joined #RubyOnRails
[05:18:58] bga57: has joined #RubyOnRails
[05:21:19] TvL2386: has joined #RubyOnRails
[05:54:16] conta: has joined #RubyOnRails
[05:56:36] hahuang65: has joined #RubyOnRails
[06:17:50] srinidhi: has joined #RubyOnRails
[06:22:00] reber: has joined #RubyOnRails
[06:58:57] srinidhi: has joined #RubyOnRails
[07:00:46] fcser_: has joined #RubyOnRails
[07:24:54] mangold: has joined #RubyOnRails
[07:33:47] westoque: has joined #RubyOnRails
[07:37:52] eckhardt: has joined #RubyOnRails
[08:01:09] defsdoor_: has joined #RubyOnRails
[08:18:22] ariejan: has joined #RubyOnRails
[08:24:57] w0rd-driven: has joined #RubyOnRails
[08:42:04] conta1: has joined #RubyOnRails
[08:48:33] srinidhi: has joined #RubyOnRails
[08:50:05] lxsameer: has joined #RubyOnRails
[08:51:49] mangold: has joined #RubyOnRails
[09:32:17] srinidhi: has joined #RubyOnRails
[09:39:59] matthewd: has joined #RubyOnRails
[09:45:31] hahuang65: has joined #RubyOnRails
[09:47:28] GreekFreak: has joined #RubyOnRails
[09:49:21] GreekFreak: I wanted to know if there was a way to exclude certain routes from production. I would like the test system to display these routes, but not in production. Specifically, I want to expose the /apidocs/api-docs.json so that my front-end developer can see the API spec with a pretty Swagger UI, but I don't want that route to be available in production
[09:49:57] GreekFreak: * by test system I mean "test" envirnment, or more precisely, staging
[09:51:09] apparition: has joined #RubyOnRails
[09:52:05] GreekFreak: Of course any other solutions to expose an API privately, are welcome, but I'm looking for a solution that scrapes the API documentation details from within my code (e.g. swagger-docs gem) instead of my using an external platform like SwaggerHub
[09:54:51] kapil____: has joined #RubyOnRails
[10:07:34] aep: has joined #RubyOnRails
[10:08:27] aep: heya! any idea why a simple Foo.find_by_sql [" select * from foo join bar.."] returns Foo.id set to bar.id rather than foo.id ?
[10:15:14] xuyuheng: has joined #RubyOnRails
[10:16:31] wethu: has joined #RubyOnRails
[10:47:10] lankanmon: has joined #RubyOnRails
[10:48:07] GreyHame: has joined #RubyOnRails
[10:49:51] za1b1tsu: has joined #RubyOnRails
[10:51:02] uks: has joined #RubyOnRails
[11:02:49] Stimpy_: has joined #RubyOnRails
[11:21:33] hhzza: has joined #RubyOnRails
[11:25:53] wethu: has joined #RubyOnRails
[11:49:09] Hates__: has joined #RubyOnRails
[11:55:53] srinidhi: has joined #RubyOnRails
[11:55:57] Stimpy_: im trying to create a document management system in rails and i cant figure out how to do the following association: document has and belongs to many documents and documents has and belongs to many forms
[11:57:26] Stimpy_: how would i go about creating a document thats assigned to itself
[11:58:50] hhzza: https://guides.rubyonrails.org/association_basics.html#self-joins ?
[12:00:32] Stimpy_: @hhzza thanks!
[12:05:40] cek: has joined #RubyOnRails
[12:07:47] cam27: has joined #RubyOnRails
[12:08:19] cek: what do you think the proper upgrade path from 3.2 to 5.1 be? `rails new`?
[12:32:13] hnanon: has joined #RubyOnRails
[12:32:20] hahuang65: has joined #RubyOnRails
[13:00:34] pd09041999: has joined #RubyOnRails
[13:03:10] srinidhi: has joined #RubyOnRails
[13:07:48] NeXTSUN: has joined #RubyOnRails
[13:08:21] mangold: has joined #RubyOnRails
[13:23:52] krawchyk: has joined #RubyOnRails
[13:30:59] orbyt_: has joined #RubyOnRails
[13:39:03] Stimpy_: i cant seem to get the self join working. what i need is something like this: a "document" has and belongs to many "documents". i looked at the guide but i cant figure out how to apply it to my model... heres the paste https://www.pastiebin.com/5c8a591cab918
[13:42:16] pd09041999: has joined #RubyOnRails
[13:48:08] ams__: has joined #RubyOnRails
[14:12:24] srinidhi: has joined #RubyOnRails
[14:18:41] cam27: has joined #RubyOnRails
[14:26:57] snk: has joined #RubyOnRails
[14:26:59] snk: good morning folks
[14:32:53] xco: has joined #RubyOnRails
[14:33:11] xco: Hi is there a method in Rails/Ruby that does this? ‘Time.now.to_i.to_s’
[14:43:16] hnanon: has joined #RubyOnRails
[14:43:45] snk: What you have there will work
[14:43:57] snk: are you looking for something cleaner, or a helper method?
[14:44:37] xco: snk: rather something cleaner, thought there’s be a shortcut or something
[14:46:11] snk: i'm not aware of a shortcut like that (doesn't mean there isn't one, i suppose)
[14:46:20] snk: one could also do `Time.now.strftime('%s')`
[14:46:34] snk: fewer steps, i guess
[14:47:03] marahin: maybe I've been working in Go a bit too much lately
[14:47:08] marahin: but how is that unclear
[14:47:24] Zarathu: has joined #RubyOnRails
[14:47:37] marahin: get current time, in a form of a timestamp, and make it a string
[14:47:45] snk: heh, yeah, i wouldn't say that to_i.to_s is unclear either
[14:47:54] Zarathu: oh, whoops
[14:47:56] snk: feels a little dirty to cast to an int and then a string
[14:48:00] Zarathu: meant to join #elixir-lang. typo
[14:48:03] Zarathu: has left #RubyOnRails: ()
[14:48:08] snk: but, not unclear
[14:49:07] Stimpy_: any idea on how to make the relationship work in both ways? or am i just thinking wrong? https://www.pastiebin.com/5c8a591cab918
[14:49:36] xco: hahaha i don’t think Time.now.to_i.to_s is unclear it is! Just checking if there could be a short cut to it or something
[14:50:51] snk: yeah, i'd say that the strftime is fewer hops, but not sure if it wins you any beauty contests either :)
[14:52:04] Stimpy_: like that it
[14:53:54] Stimpy_: it's possible to create documents that belong to a document, but somehow im not able to see in the other direction. Meaning i cant see which document a document is assigned to
[14:58:05] havenwood: stimpy_: there's HABTM and the more flexible Has Many Through: https://rubyplus.com/articles/3451-Has-Many-Through-and-Has-and-Belongs-to-Many-in-Rails-5
[14:58:34] havenwood: stimpy_: https://medium.com/rubycademy/habtm-to-has-many-through-43f68f50e50e
[14:58:58] havenwood: stimpy_: https://guides.rubyonrails.org/association_basics.html#has-and-belongs-to-many-association-reference
[15:03:02] krawchyk: has joined #RubyOnRails
[15:04:21] Stimpy_: @havenwood first of all, thanks for the resources! but my issue is that i have the "document" model that has and belongs to many documents which would be a self join, or am i thinkng wrong
[15:06:20] havenwood: stimpy_: ahh, i didn't catch that...
[15:06:56] havenwood: stimpy_: i don't know a recent writeup on same model habtm. if you haven't looked at it yet, there's: https://cobwwweb.com/bi-directional-has-and-belongs-to-many-on-a-single-model-in-rails
[15:07:04] havenwood: i can't vouch for the approach
[15:07:19] Stimpy_: i can assign many documents to a document, but when i get into one of the "assigned documents" i cant see the what it was assigned to
[15:07:43] homebear: has joined #RubyOnRails
[15:09:43] cek: getting segfaults on mysql2 @ ruby 2.4.5
[15:09:52] cek: clean `rails new`
[15:12:44] Stimpy_: @havenwood thanks for the last link
[15:13:13] cek: reinstalled mysql2 , all's fine now :/
[15:16:40] homebear: Hi all! I'm getting a "Can't verify CSRF token authenticity" error on my app but only when I disable JavaScript in the browser. The form in question works fine submitting via AJAX. When I search online about this issue, all I have found is recommendations of adding the token to any ajax forms but I didn't do anything special to get it working. It's strangely not working without JavaScript. Any ideas why this might be happening? Thanks!
[15:24:25] rascencio: has joined #RubyOnRails
[15:26:35] srinidhi: has joined #RubyOnRails
[15:30:47] za1b1tsu: has joined #RubyOnRails
[15:30:57] pd09041999: has joined #RubyOnRails
[15:31:24] jaddison: has joined #RubyOnRails
[15:33:52] Ergo: has joined #RubyOnRails
[15:45:32] jamilbk: has joined #RubyOnRails
[15:58:56] apparition: has joined #RubyOnRails
[15:59:37] krawchyk: has joined #RubyOnRails
[16:01:36] gambl0r3: has joined #RubyOnRails
[16:03:58] mangold: has joined #RubyOnRails
[16:06:58] krawchyk: has joined #RubyOnRails
[16:11:56] krawchyk: has joined #RubyOnRails
[16:13:56] pd09041999: has joined #RubyOnRails
[16:25:40] Technodrome: has joined #RubyOnRails
[16:28:01] [Butch]: has joined #RubyOnRails
[16:31:36] Travis-42: has joined #RubyOnRails
[16:33:40] tdy1: has joined #RubyOnRails
[16:36:53] tdy1: has joined #RubyOnRails
[16:44:22] krawchyk: has joined #RubyOnRails
[16:46:20] hahuang65: has joined #RubyOnRails
[16:46:28] KeyJoo: has joined #RubyOnRails
[16:49:28] hnanon: has joined #RubyOnRails
[16:50:17] srinidhi: has joined #RubyOnRails
[16:50:26] orbyt_: has joined #RubyOnRails
[17:00:12] NeXTSUN: has joined #RubyOnRails
[17:00:44] krawchyk: has joined #RubyOnRails
[17:03:44] krawchyk: has joined #RubyOnRails
[17:03:47] orbyt_: has joined #RubyOnRails
[17:07:31] gambl0r3: has joined #RubyOnRails
[17:15:09] Dbugger: has joined #RubyOnRails
[17:16:28] gambl0re: has joined #RubyOnRails
[17:25:11] sagax: has joined #RubyOnRails
[17:25:29] sagax: how to get only `id` in activerecord ?
[17:26:57] sagax: i can use `map` like as Some.all.map {|s| s.id}
[17:27:01] sagax: to get all ids
[17:27:14] sagax: but maybe activerecord already can do this
[17:27:26] mello: has joined #RubyOnRails
[17:33:45] hhzza: @sagax Some.all.pluck(:id)
[17:38:39] Saukk: has joined #RubyOnRails
[17:42:48] orbyt_: has joined #RubyOnRails
[17:44:56] gambl0re: has joined #RubyOnRails
[17:46:31] kapil____: has joined #RubyOnRails
[17:50:41] dionysus70: has joined #RubyOnRails
[17:51:24] dionysus70: I have a form with file_input multiple, I am using active storage, I couldn't find documentation where i can make the files for deletion, like in case of nested_attributes: [id, _destroy]
[17:51:46] dionysus70: anyone know of a DRY way to get rid of existing files in edit form? while using active storage *
[18:03:19] ravenousmoose: has joined #RubyOnRails
[18:09:44] za1b1tsu: I've generate a scaffold and it genetared a controller test. In the controller test there is a setup that is passed a block with @model = model(:one)
[18:09:51] za1b1tsu: what is this model(:one) ??
[18:11:24] za1b1tsu: ah it get data from fixtures, ok..
[18:21:07] cam27: has joined #RubyOnRails
[18:25:12] tdy2: has joined #RubyOnRails
[18:27:01] orbyt_: has joined #RubyOnRails
[18:34:35] tdy: has joined #RubyOnRails
[18:48:13] xco: has left #RubyOnRails: ()
[18:51:03] hahuang65_: has joined #RubyOnRails
[18:51:15] atrius: has joined #RubyOnRails
[18:56:35] orbyt_: has joined #RubyOnRails
[19:06:08] tdy1: has joined #RubyOnRails
[19:08:39] tdy1: has joined #RubyOnRails
[19:12:33] tdy2: has joined #RubyOnRails
[19:14:20] sameerynho: has joined #RubyOnRails
[19:20:18] hahuang65: has joined #RubyOnRails
[19:34:31] ss942: has joined #RubyOnRails
[19:43:03] cam27: has joined #RubyOnRails
[19:54:12] orbyt_: has joined #RubyOnRails
[20:04:07] rascencio: has joined #RubyOnRails
[20:09:35] beingjohnm: has joined #RubyOnRails
[20:10:56] ur5us: has joined #RubyOnRails
[20:25:03] uksio: has joined #RubyOnRails
[20:37:54] NeXTSUN: has joined #RubyOnRails
[20:48:50] orbyt_: has joined #RubyOnRails
[20:52:29] cxl: How can I get the console to print records like here? (this was with rails 2) https://imgur.com/d38ayGl
[21:13:02] unreal: has joined #RubyOnRails
[21:14:26] Fernando-Basso: has joined #RubyOnRails
[21:19:59] ravenousmoose: has joined #RubyOnRails
[22:02:38] eddof13: has joined #RubyOnRails
[22:08:47] gambl0re: has joined #RubyOnRails
[22:23:42] NeXTSUN: has joined #RubyOnRails
[22:36:57] hnanon: has joined #RubyOnRails
[22:40:52] wethu: has joined #RubyOnRails
[22:43:51] cam27: has joined #RubyOnRails
[22:54:27] orbyt_: has joined #RubyOnRails
[23:07:02] baweaver: cxl: HIRB, but it hasn't been updated in quite a while: http://tagaholic.me/hirb/doc/index.html
[23:12:13] quazimodo: has joined #RubyOnRails
[23:34:11] ellcs: has joined #RubyOnRails
[23:37:43] orbyt_: has joined #RubyOnRails
[23:49:03] elcontrastador: has joined #RubyOnRails
[23:53:02] rascencio: has joined #RubyOnRails