#RubyOnRails - 18 September 2018
« Back 1 day Forward 1 day »
[00:08:46] i8igmac: is there a faster way to get recursive results of a directory other then Dir.glob("tmp/**/*")
[00:15:19] baweaver: Gemfile, `pry-rails`, and then just put binding.pry in your code wherever you want it to stop
[02:06:02] ShekharReddy: help me writing this (something & something2) | (something &someting) && (something )on active record
[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: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:25:37] Radar: i8igmac: https://stackoverflow.com/questions/5520501/ruby-create-recursive-directory-tree
[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: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
[04:01:51] havenwood: samscam7: For general pry questions, you might want to ask in the #ruby channel.
[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: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>
[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
[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?
[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
[11:01:53] Terens: does it make sense to you to have an authorization system in rails that stores for every controller and action
[12:35:53] TvL2386: Terens: but if that is what you want/need, then you will have to implement it :)
[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
[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: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: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.
[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
[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: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:25:02] DoctorMonocular: thanks havenwood -- it looks different, but maybe I'll just use the different api :)
[18:40:42] Terens: what would you do if other developer forced you to put all domain logic in callbacks ?
[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: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: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
[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: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