Page 1 of 14 | Next »
[17:12:23] Pupeno: I'm converting a project from MySQL to PostgreSQL. After configuring it, I get the error: ActiveRecord::ConnectionTimeoutError: could not obtain a connection from the pool within 5.000 seconds (waited 5.000 seconds); all pooled connections were in use. I tried increasing the pool to 50. Another rails project on the same machine uses postgresql just fine. Any ideas what might be going ?
[17:34:24] Pupeno: havenwood: this is happening during rake db:migrate or rake db:create, so, I'm not sure the web server would have any effect, would it?
[08:35:15] Pupeno: If you are overriding the method you are changing the behaviour of the method. Are you trying to wrap an existing method with your own functionality?
[08:37:38] Pupeno: I don't think it's possible to define a method with def and have it have the same arguments as the one in the parent class.
[08:38:48] Pupeno: In Ruby you can do pretty much whatever you want, so, you can write class Object; def to_s; end; end and re-define the the to_s method in the Object class.
[08:39:33] Pupeno: Yes, you can inspect the method in the parent class, find how many arguments it has, and create a new method with the same amount of arguments, but I don't think this is worthy.
[08:40:02] Pupeno: What I just described with Object is not inheritance, it's opening up an existing class and modifying it.
[08:40:57] Pupeno: No. There's no inheritance at play there. The moment you do that, every object in the system will have a new implementation of that method IIRC.
[08:42:24] Pupeno: It is redefining to_s for that class, yes. It's called monkey-patching and it's generally frowned upon because it's messy and dangerous.
[08:42:59] Pupeno: You can completely ignore it... I just missinterpreted your question as you doing monkey-patching, instead of proper inheritance overriding.
[08:45:53] Pupeno: Why not just hard-code the argument and argument names to match the parent's class's method?
[08:48:31] Pupeno: If you get *args and then pass it to the method, and it doesn't match the new amount of arguments, do you get an error that's hard to understand? I can't remember.
[08:50:36] Pupeno: Another possibilty is to check, on-load-time, whether the amount of arguments of the parent class is what you expected when writing your code, and if it's not, fail to load your class with a descriptive error message about tweaking the class. Not the same as matching the parent method.
[08:50:54] Pupeno: It's possible there's another solution that I'm forgetting about. I just came back to Ruby after a while.
[09:14:34] Pupeno: This channel seems very quiet compared to other programming languages. Are Rubists hanging out somewhere else?
[09:18:27] Pupeno: zenspider: take a look at #python, 2am pacific time and it's busting with activity.
[09:19:20] Pupeno: I know the Python community is biggen than Ruby, but the discrepancy in activity seems bigger, so, I'm wondering if people moved to Slack or something.
[09:47:21] Pupeno: dogweather: I'd tend to agree. I prefer my testing code to be closer to just plain ruby code, hence not a fan of neither rspec nor shoulda-matchers. I do find that shoulda-context helps a lot with tests that have common parts. I'm a fan.
[14:18:57] Pupeno: Can I expect the latest mysql2 gem, 0.5.2, to work with MySQL 5? I have MySQL 8 on my dev machine, but the server has MySQL 5.
[10:47:21] Pupeno: I'm using Rails 5.2, I'm getting an error on CircleCI about Devise.secret_key not set. I set up the SECRET_KEY_BASE environment variable. What else am I missing?
[11:01:51] Pupeno: It's not defined. According to the comment: Devise will use the `secret_key_base` as its `secret_key` by default.
[14:42:29] Pupeno: How do I link to a route that looks like this (without naming it): get "/java_modules/:group_id/:artifact_id/:version", to: "java_modules#show" ?
[16:08:05] Pupeno: fryguy: as far as I see, no name: GET /java_modules/:group_id/:artifact_id/:version(.:format) java_modules#show
[14:01:14] Pupeno: I haven't done Rails in quite a while. Back in the day I was using Bootstrap. Is it still a good option with good integration? Or should I explore something else?
[14:12:15] Pupeno: Should I handle it with webpack? This project is not going to use React or any of the other big frameworks for JS. It's still going to have some Javascrip.t
[16:29:14] Pupeno: How do you keep your development database credentials out of your database.yml (that is, out of the repo)?
[08:32:45] Pupeno: What's a good way of testing the performance of Ruby and Rails on Windows to see how good or bad is this days and to compare using the Linux subsystem vs the native installer?
[09:05:58] Pupeno: sylario: I'm not using Windows in production. And last time I tested, which each request taking between 4 and 10 seconds, speed was a problem. Developing in Windows was unbearable.
[09:10:33] Pupeno: PostgreSQL is fine. I have postgresql installed and I'm using it for non-ruby projects.
[09:13:20] Pupeno: Last time I tried native Ruby on Windows, Ruby on the Windows Subsystem for Linux, and Ruby in a VM. They were all horribly slow due to I/O speed; even on my Intel 750 PCIe.
[10:11:45] Pupeno: sylario: yes, most likely, although it seems the way Ruby and Rails do IO to be the source of a lot of problems.
[15:31:20] Pupeno: I added a comments sub resource to post, and I ended up with this route: post_comments GET /posts/:post_id/comments(.:format) comments#show. Why is it show and not index? Why is there no single comment show route either? Is this new?
[15:38:08] Pupeno: No, I don't think it's shallow: https://gist.github.com/pupeno/1934d4faedede5c622a50b474f16ce26
[15:38:24] Pupeno: Also, I don't have /comments/:id, which would be what a shallow route would provide.
[15:51:46] Pupeno: Found the problem. I was using singular instead of plural, resource vs resources for the nested resource.
[16:17:34] Pupeno: Does anybody have an idea on how to test the current viability of developing Rails on Windows? performance seems to have improved since the last time I tried it, but I'm open to anything that would help me push my set up harder. Any popular gems that are hard to build?
[16:23:08] Pupeno: sylario: every time I tried running it in a VM it was clunky as hell (no way to run it from RubyMine, debug it, etc) and not faster than native thanks to I/O transaltion.
[16:24:26] Pupeno: Right now I'm not interesting in setting up Ruby differently but testing whether the native Ruby and Rails would work well enough to take some contract work without having to go and get a mac (or having to dual boot).
[16:26:44] Pupeno: sylario: when they released the last interation of mbp, instead of buying one, I spent the same amount building a beast of a desktop. I got annoyed enough at Apple and I'd rather stay away from Macs.
[16:27:27] Pupeno: I need some contract work to keep me going while I market my startup, so, I'm exploring doing some Ruby and Rails, if not, I'll stay in the Clojure world, but there's way more work in RoR rather than Clojure.
[16:34:03] Pupeno: sylario: I have an intel 720 PCIe. Not big enough for dual boot. I do need some of the "distractions" and I don't want to deal with the small idiosyncrasis of getting used to a different UI. If I have to put up with that, I'd rather do Clojure (or Python or whatever).
[16:49:39] Pupeno: What's the ImageMagick gem that uses the C library (instead of command line) that tends to be tricky to get working?