« Back to channel list

#RubyOnRails - 18 September 2018

« Back 1 day Forward 1 day »
[00:01:27] davidh38: has joined #RubyOnRails
[00:02:30] cagomez: has joined #RubyOnRails
[00:08:46] i8igmac: is there a faster way to get recursive results of a directory other then Dir.glob("tmp/**/*")
[00:12:24] knight33: has joined #RubyOnRails
[00:12:38] i8igmac: nvm. my machine ssd is probably going out...
[00:13:30] samscam7: @baweaver pry looks like itss exactly what i need
[00:14:47] samscam7: where in my app do you think i should put it tho?
[00:15:19] baweaver: Gemfile, `pry-rails`, and then just put binding.pry in your code wherever you want it to stop
[00:16:27] samscam7: so like in my view or somewhere else?
[00:24:25] davidh38: has joined #RubyOnRails
[00:37:56] eckhardt_: has joined #RubyOnRails
[00:43:44] Radar: GOOD MORNING
[00:50:08] fragamus: has joined #RubyOnRails
[00:53:29] weaksauce: has joined #RubyOnRails
[01:06:26] sevenseacat: has joined #RubyOnRails
[01:17:02] jottr: has joined #RubyOnRails
[01:36:10] lxsameer: has joined #RubyOnRails
[01:45:08] knight33: has joined #RubyOnRails
[01:47:08] ariedler: has joined #RubyOnRails
[01:52:10] jottr: has joined #RubyOnRails
[01:55:43] fragamus: has joined #RubyOnRails
[02:01:34] ShekharReddy: has joined #RubyOnRails
[02:06:02] ShekharReddy: help me writing this (something & something2) | (something &someting) && (something )on active record
[02:06:17] ShekharReddy: in the where condition
[02:29:50] darkhanb: has joined #RubyOnRails
[02:33:45] samscam7: has joined #RubyOnRails
[02:50:11] srruby: has joined #RubyOnRails
[03:10:32] i8igmac: im having a hell of a time getting a recursive dir tree to display with jstree
[03:10:37] braincrash: has joined #RubyOnRails
[03:10:48] i8igmac: i keep starting over from scratch
[03:11:34] i8igmac: it feels like im trying to recreate the wheel
[03:11:53] samscam7: has joined #RubyOnRails
[03:12:21] cagomez: has joined #RubyOnRails
[03:12:26] i8igmac: i need Dir.glob(/tmp/**/*) to produce results in a specific way that i can insert proper opening and closing tags
[03:12:38] samscam7: @baweaver is there any way to just point pry to a function and trace the stack from there?
[03:17:15] duderonomy: has joined #RubyOnRails
[03:20:11] Radar: i8igmac: what is it producing now and how is that wrong?
[03:22:28] i8igmac: its more or less a algorithm mind twister. the order of html tags that need to be inserted into the array
[03:22:51] i8igmac: im working on a basic demo page, then ill try to build the algo... im starting over
[03:23:14] helpa: http://i.imgur.com/m9m3wr9.gif
[03:23:57] knight33: has joined #RubyOnRails
[03:25:37] Radar: i8igmac: https://stackoverflow.com/questions/5520501/ruby-create-recursive-directory-tree
[03:26:53] i8igmac: Radar: thanks, i may have looked over that... ill take a closer look
[03:27:36] Radar: Of course you can do `tree -j /tmp` too.
[03:27:49] Radar: sorry, tree -J
[03:29:36] Radar: https://gist.github.com/radar/e8b429097de38962884b304e3dfbc0bb
[03:30:45] i8igmac: thanks for your help, i need to see if i can take these resaults and produce with jstree a working demo
[03:31:16] i8igmac: https://pastebin.com/PCLJN05F
[03:31:29] i8igmac: its just junk a few junk folders and unk files
[03:32:58] i8igmac: https://www.jstree.com/docs/html/
[03:33:19] i8igmac: i think i just need to place this infront of it
[03:33:20] i8igmac: $('#tree').jstree(
[03:36:47] lxsameer: has joined #RubyOnRails
[03:37:30] i8igmac: this json is so ugly
[03:43:22] i8igmac: i was trying to do it in html, because json is a ugly hash
[03:47:16] samscam7: anyone familiar with pry?
[03:53:04] jottr: has joined #RubyOnRails
[03:53:10] tdy: has joined #RubyOnRails
[03:54:56] wethu: has joined #RubyOnRails
[03:57:30] i8igmac: Radar: i think your `tree -j /tmp` example might be best for me
[03:57:35] Technodrome: has joined #RubyOnRails
[03:57:59] Radar: i8igmac: I think so too. It'd be easy enough to process that output and to turn it into Ruby.
[03:58:05] i8igmac: the examples i see posted on that stackoverflow are not recursive... and the results are a ugly mess
[03:59:01] i8igmac: i need to see if i can understand this json crap
[03:59:24] i8igmac: [{}{}],[{}{}[{}{}[}{[][as][}{}{]
[04:00:21] i8igmac: https://www.jstree.com/docs/json/
[04:00:40] i8igmac: this looks like the format that i need to orginize the hash with
[04:01:51] havenwood: samscam7: For general pry questions, you might want to ask in the #ruby channel.
[04:02:23] i8igmac: Radar: i should be able to do something like this
[04:02:28] samscam7: im just trying to figure out why it wont cause my app to break
[04:02:36] samscam7: what server is #ruby on?
[04:02:41] havenwood: samscam7: this one
[04:02:48] i8igmac: $('#jstree').jstree({ 'core' : { `tree -J /tmp`}});
[04:03:19] samscam7: aight ima go there
[04:03:34] Radar: i8igmac: Probably not. not sure what jstree requires as the output.
[04:03:38] Radar: or input, I guess.
[04:07:50] i8igmac: Radar: this is a frustrating ugly mess...
[04:14:12] srinidhi: has joined #RubyOnRails
[04:20:10] i8igmac: everything is no longer in development
[04:23:18] i8igmac: Radar: essentially what im looking to do is create a tree view and then load the file content into ace-code-editor
[04:23:43] i8igmac: a code editor in the browser of my rails app
[04:24:03] i8igmac: maybe there is already a working plugin that does all of this?
[04:35:27] lxsameer: has joined #RubyOnRails
[04:47:57] Linuus: has joined #RubyOnRails
[04:48:13] jackhum: has joined #RubyOnRails
[04:51:04] i8igmac: Radar: i found a solution. for a piece of mind... it was what i orginal was aiming for... wrapping everything in <ul></ul>
[04:51:11] i8igmac: https://github.com/omardelarosa/ruby-file-tree/blob/master/Readme.md
[04:57:01] Linuus: has joined #RubyOnRails
[05:02:55] duderonomy: has joined #RubyOnRails
[05:18:24] reber: has joined #RubyOnRails
[05:20:18] Technodrome: has joined #RubyOnRails
[05:23:00] Linuus: has joined #RubyOnRails
[05:46:10] MoritaShinobu: has joined #RubyOnRails
[05:48:51] ariedler: has joined #RubyOnRails
[05:55:08] snickers: has joined #RubyOnRails
[05:55:48] jottr: has joined #RubyOnRails
[06:04:21] Linuus: has joined #RubyOnRails
[06:13:18] Technodrome: has joined #RubyOnRails
[06:27:45] mark-6: has joined #RubyOnRails
[06:28:52] mark-6: has left #RubyOnRails: ()
[06:34:54] za1b1tsu: has joined #RubyOnRails
[06:41:28] tdy: has joined #RubyOnRails
[06:42:59] lomex: has joined #RubyOnRails
[07:03:06] Technodrome: has joined #RubyOnRails
[07:06:04] srinidhi: has joined #RubyOnRails
[07:33:22] dionysus69: if anyone is using cloudflare here, how do you block IPs that try to brute force login, I tried fail2ban, it bans my ip fine but I still get access, I disable cloudflare and only then I get banned
[07:33:55] dionysus69: I inserted nginx module to restore original IPs for cloudflare redirected http/https requests but still no luck
[07:38:16] Linuus: has joined #RubyOnRails
[07:42:54] evexor: has joined #RubyOnRails
[08:08:40] sandstrom: has joined #RubyOnRails
[08:08:51] civ_addict: has joined #RubyOnRails
[08:25:36] lxsameer: has joined #RubyOnRails
[08:39:47] mojtaba: has joined #RubyOnRails
[08:41:05] mojtaba: Hello, I am reading about Concerns. But in the examples, there is a line include ActiveSupport::Concern, in the module, and then that module is included in another class. What does that line do? What happens if it was not there?
[08:48:18] uksio: has joined #RubyOnRails
[08:55:27] apeiros: has joined #RubyOnRails
[09:00:48] mikecmpbll: has joined #RubyOnRails
[09:03:17] NL3limin4t0r: has joined #RubyOnRails
[09:08:46] mikecmpbll: has joined #RubyOnRails
[09:09:50] srinidhi: has joined #RubyOnRails
[09:22:50] ur5us: has joined #RubyOnRails
[09:39:50] mojtaba: has joined #RubyOnRails
[09:41:04] kapil___: has joined #RubyOnRails
[09:50:25] ariedler: has joined #RubyOnRails
[10:04:11] srinidhi: has joined #RubyOnRails
[10:05:18] srinidhi: has joined #RubyOnRails
[10:07:15] TvL2386: hi everyone. I'm currently having 2 database connections to the same mssql server to retrieve data from my rails database and some other db. I want to do JOIN queries that join tables from both databases. That's not possible using 2 separate connections right
[10:08:17] Linuus: has joined #RubyOnRails
[10:09:12] TvL2386: Is this even possible?
[10:12:05] apeiros_: has joined #RubyOnRails
[10:35:53] jottr: has joined #RubyOnRails
[10:42:42] apparition: has joined #RubyOnRails
[10:47:52] wethu: has joined #RubyOnRails
[10:48:47] lankanmon: has joined #RubyOnRails
[10:56:39] mojtaba: has joined #RubyOnRails
[11:01:19] Terens: has joined #RubyOnRails
[11:01:53] Terens: does it make sense to you to have an authorization system in rails that stores for every controller and action
[11:02:01] Terens: and user role
[11:02:10] Terens: a hash with visible/editable model attributes ?
[11:02:34] Terens: having many models and multitenant
[11:13:18] TvL2386: Terens: only if it fits your requirements
[11:21:39] MaiconVieira: has joined #RubyOnRails
[11:27:29] Terens: I feel like it is very complex
[11:27:39] mojtaba: has joined #RubyOnRails
[11:57:08] GodFather: has joined #RubyOnRails
[11:59:50] jottr: has joined #RubyOnRails
[12:07:16] jottr: has joined #RubyOnRails
[12:19:09] Ergo: has joined #RubyOnRails
[12:19:54] GodFather: has joined #RubyOnRails
[12:25:00] knight33: has joined #RubyOnRails
[12:35:18] TvL2386: Terens: that's because it is
[12:35:53] TvL2386: Terens: but if that is what you want/need, then you will have to implement it :)
[12:38:24] Linuus: has joined #RubyOnRails
[12:40:09] TvL2386: Terens: you're not even talking about authorizing access to instances of models. Maybe you want to be able to edit your own user profile, but not the profile of other users
[12:43:49] IanMalcolm: has joined #RubyOnRails
[12:46:27] alexhartley[m]: has joined #RubyOnRails
[12:48:32] sandstrom: has joined #RubyOnRails
[12:50:03] marahin: has joined #RubyOnRails
[12:58:56] sirfilip: has joined #RubyOnRails
[12:59:04] sirfilip: morning all
[12:59:23] sirfilip: where can i find a good tut for creating a custom renderer
[12:59:32] psychoslave: has joined #RubyOnRails
[13:00:05] sirfilip: i want to render my files from a database instead from the filesystem, but i cant find anything similar tutorial no how it's can be done
[13:00:28] sirfilip: g/sub/no/on
[13:01:01] sirfilip: have anyone tried this before ?
[13:10:22] NL3limin4t0r: TvL2386: Joining tables from different databases is possible as long as they are on the same server. https://stackoverflow.com/a/11427098/3982562
[13:11:27] Technodrome: has joined #RubyOnRails
[13:12:10] NL3limin4t0r: However a join is a query to be submitted through 1 of the 2 connections you have. That connection user need to have at least read rights for both tables in both databases.
[13:15:07] NL3limin4t0r: As far as I know Arel doesn't account for different databases, so you might need to write the query yourself.
[13:23:16] GodFather: has joined #RubyOnRails
[13:29:54] knight33: has joined #RubyOnRails
[13:38:32] Linuus: has joined #RubyOnRails
[14:00:59] mojtaba: has joined #RubyOnRails
[14:01:11] Linuus: has joined #RubyOnRails
[14:06:00] za1b1tsu: has joined #RubyOnRails
[14:16:02] sandstrom: has joined #RubyOnRails
[14:25:11] sandstrom: has joined #RubyOnRails
[14:39:00] dblessing: has joined #RubyOnRails
[14:46:07] chouhoulis: has joined #RubyOnRails
[14:47:14] DTZUZO_: has joined #RubyOnRails
[14:50:34] desperek: has joined #RubyOnRails
[14:53:42] lomex: has joined #RubyOnRails
[15:00:43] Technodrome: has joined #RubyOnRails
[15:06:12] apeiros_: has joined #RubyOnRails
[15:10:10] cschneid_: has joined #RubyOnRails
[15:25:37] lexileo: has joined #RubyOnRails
[15:37:02] ivanskie: has joined #RubyOnRails
[15:43:58] ircuser: has joined #RubyOnRails
[15:44:36] ircuser: am i visible to the fellow users here?
[15:49:31] cagomez: has joined #RubyOnRails
[15:50:04] Gabriel17: Unforunately not?
[15:55:41] cagomez: has joined #RubyOnRails
[15:56:27] cagomez: has joined #RubyOnRails
[15:57:02] cagomez: has joined #RubyOnRails
[15:57:37] cagomez: has joined #RubyOnRails
[15:58:17] cagomez: has joined #RubyOnRails
[15:58:57] cagomez: has joined #RubyOnRails
[16:04:56] snickers: has joined #RubyOnRails
[16:09:35] Dbugger: has joined #RubyOnRails
[16:15:42] tdy1: has joined #RubyOnRails
[16:23:31] TvL2386: hi NL3limin4t0r, thanks for your response
[16:24:35] TvL2386: I knew it was possible, I was just wondering if rails can do it (activerecord / arel)
[16:25:18] TvL2386: I have a few models in db1 through connection1 and I have some other models in db2 through connection2. I've given rights to the user user ind connection1 to also access db2
[16:26:44] TvL2386: so in theory one connection is enough, I just have to tell each model in which db they are
[16:31:50] Gabriel17: i got a hairy problem accessing nested attributes from the current_user of devise. has someone time and the willpower to help me out? i think it might be easy for advances rails developer
[16:34:55] srinidhi: has joined #RubyOnRails
[16:39:37] eckhardt_: has joined #RubyOnRails
[16:39:55] DTZUZO_: has joined #RubyOnRails
[16:45:59] Technodrome: has joined #RubyOnRails
[16:51:22] darkhanb: has joined #RubyOnRails
[17:02:51] prettybTech: has joined #RubyOnRails
[17:14:00] DoctorMonocular: has joined #RubyOnRails
[17:14:35] DoctorMonocular: I used to use the classy_enum gem, but it's pretty old and I'm worried that it will break at some unknown time
[17:14:42] DoctorMonocular: is there a gem the cool kid use now?
[17:16:04] mikecmpbll: has joined #RubyOnRails
[17:19:48] havenwood: DoctorMonocular: I've not used classy_enum, so I'm not sure if there's feature parity - but Enumerize is nice: https://github.com/brainspec/enumerize
[17:24:36] ShekharReddy: has joined #RubyOnRails
[17:25:02] DoctorMonocular: thanks havenwood -- it looks different, but maybe I'll just use the different api :)
[17:45:41] duderonomy: has joined #RubyOnRails
[17:48:08] GodFather: has joined #RubyOnRails
[17:48:39] lxsameer: has joined #RubyOnRails
[17:58:44] lxsameer: has joined #RubyOnRails
[18:04:49] MaiconVieira: has joined #RubyOnRails
[18:08:48] lxsameer: has joined #RubyOnRails
[18:11:25] conta1: has joined #RubyOnRails
[18:13:40] NoGodDamnIdea: has joined #RubyOnRails
[18:17:24] za1b1tsu: has joined #RubyOnRails
[18:18:49] lxsameer: has joined #RubyOnRails
[18:21:08] weaksauce: has joined #RubyOnRails
[18:21:13] deathwishdave: has joined #RubyOnRails
[18:22:47] apeiros_: has joined #RubyOnRails
[18:27:37] apeiros_: has joined #RubyOnRails
[18:28:49] lxsameer: has joined #RubyOnRails
[18:31:00] blackmesa: has joined #RubyOnRails
[18:33:09] fragamus: has joined #RubyOnRails
[18:37:23] donnie: has joined #RubyOnRails
[18:38:51] lxsameer: has joined #RubyOnRails
[18:39:03] Terens: has joined #RubyOnRails
[18:40:42] Terens: what would you do if other developer forced you to put all domain logic in callbacks ?
[18:48:53] lxsameer: has joined #RubyOnRails
[18:49:18] krawchyk: has joined #RubyOnRails
[18:51:24] za1b1tsu: has joined #RubyOnRails
[18:56:21] jottr: has joined #RubyOnRails
[18:58:49] lxsameer: has joined #RubyOnRails
[19:00:13] lomex: has joined #RubyOnRails
[19:03:02] Technodrome: has joined #RubyOnRails
[19:05:01] sandstrom: has joined #RubyOnRails
[19:08:47] lxsameer: has joined #RubyOnRails
[19:08:58] emers3n: has joined #RubyOnRails
[19:10:08] emers3n: Where would a snippet like this go in a rails app, where you are performing a function based on them going to a certain page?
[19:10:08] emers3n: https://gist.githubusercontent.com/EmersonEmerson/80efefe7e77d5c509cfa6191c0721b34/raw/8a7faa3a659568b19fe093bba7e7ee7bb590f308/gistfile1.txt
[19:17:41] Inside: has joined #RubyOnRails
[19:17:48] Inside: ACTION flips over a table.
[19:17:56] Inside: DB Admin just emailed me asking why I have so many connections open to the DB and why do they keep doing SELECT 1
[19:18:37] lxsameer: has joined #RubyOnRails
[19:27:19] za1b1tsu: has joined #RubyOnRails
[19:27:37] fragamus: has joined #RubyOnRails
[19:28:51] lxsameer: has joined #RubyOnRails
[19:31:59] lord4163: has joined #RubyOnRails
[19:38:41] lxsameer: has joined #RubyOnRails
[19:45:55] tycoon177: are there any good tools out there to reduce ruby's and rails' memory footprints or at least track down problem areas? our application consumes about 300mb/instance which is higher than we'd like.
[19:46:45] tycoon177: it's a very general question, i know, but this is something that won't have a one size fits all answer
[19:48:53] lxsameer: has joined #RubyOnRails
[19:58:52] lxsameer: has joined #RubyOnRails
[20:00:05] cagomez: has joined #RubyOnRails
[20:01:08] cagomez: has joined #RubyOnRails
[20:01:45] cagomez: has joined #RubyOnRails
[20:02:28] cagomez: has joined #RubyOnRails
[20:03:26] cagomez: has joined #RubyOnRails
[20:04:01] cagomez: has joined #RubyOnRails
[20:08:54] lxsameer: has joined #RubyOnRails
[20:13:24] moei: has joined #RubyOnRails
[20:16:04] tdy: has joined #RubyOnRails
[20:18:48] lxsameer: has joined #RubyOnRails
[20:21:15] emers3n: Let's say I have a very simple form that is just a button and goes to a path on user click. What if I want to redirect to this path directly rather than requiring a click? Not having success with redirect_to
[20:21:16] emers3n: https://gist.githubusercontent.com/EmersonEmerson/ec03680a71083f325e717ff380d15a64/raw/91f89ad96a439a492d1580a1a66154217115b4dc/gistfile1.txt
[20:22:06] jottr: has joined #RubyOnRails
[20:26:08] tdy1: has joined #RubyOnRails
[20:26:31] tycoon177: emers3n: you can't redirect to any method other than get afaik
[20:28:48] lxsameer: has joined #RubyOnRails
[20:32:09] emers3n: @tycoon, okay, can you point me in the right direction for an action that can both be clicked and redirected to?
[20:35:46] emers3n: tycoon177: Nvm, I simply called the action within my controller instead of trying to do it within my view... Thanks for the help
[20:36:05] tycoon177: great to hear that you got it figured out!
[20:39:00] lxsameer: has joined #RubyOnRails
[20:46:15] Linuus: has joined #RubyOnRails
[20:47:30] blackmesa: has joined #RubyOnRails
[20:50:06] tdy1: has joined #RubyOnRails
[21:00:00] jottr: has joined #RubyOnRails
[21:04:21] weaksauce: has joined #RubyOnRails
[21:06:19] ur5us: has joined #RubyOnRails
[21:11:27] roshanavand: has joined #RubyOnRails
[21:19:42] jottr: has joined #RubyOnRails
[21:24:41] Linuus: has joined #RubyOnRails
[21:25:14] Technodrome: has joined #RubyOnRails
[21:25:53] tdy1: has joined #RubyOnRails
[21:54:06] jottr: has joined #RubyOnRails
[22:02:59] eckhardt_: has joined #RubyOnRails
[22:08:19] blackmesa1: has joined #RubyOnRails
[22:10:34] Linuus: has joined #RubyOnRails
[22:13:06] eckhardt_: has joined #RubyOnRails
[22:16:14] agent_white: has joined #RubyOnRails
[22:24:15] wethu: has joined #RubyOnRails
[22:30:08] mikecmpbll: has joined #RubyOnRails
[22:32:16] lankanmon: has joined #RubyOnRails
[22:38:27] DTZUZO_: has joined #RubyOnRails
[22:44:21] sameerynho: has joined #RubyOnRails
[22:45:04] eckhardt_: has joined #RubyOnRails
[22:54:32] eckhardt_: has joined #RubyOnRails
[23:02:09] eckhardt_: has joined #RubyOnRails
[23:07:30] prettybTech: has joined #RubyOnRails
[23:50:54] Radar: GOOD MORNIING
[23:51:02] Radar: yes you get TWO Is today. Treat them well.
[23:55:01] jottr: has joined #RubyOnRails
[23:56:58] Linuus: has joined #RubyOnRails
[23:59:15] darkhanb: has joined #RubyOnRails