Maista posted:First order of business: upgrade Ruby and Rails I've looked at the changes from Ruby 1.9.3 to 2.4 (it seems sensible to keep using latest version) and they don't seem too bad, but the changes to Rails might be worse. Since the app is relatively simple, I'm going to suggest starting from a new Rails 5 application and just migrating models one by one until an issue appears (fixing any antipatterns I spot along the way) and then fixing them one by one. I'm going to spend some time this summer tracking down the correct versions of the gems we use and I suspect there are some that can even be discarded entirely in favor of features that are now built into Rails (or simple enough to reimplement internally, depending on how much of the gems functionality we really need). I'll be extrapolating from this guide. The scariest part is the lack of tests. My plan is to write some rough integration tests for the user-facing functionality and use those as guideposts. Adding tests sounds like a good project. Upgrading the stack when the real devs are on vacation sounds like a bad project. Do you not have a backlog of tickets to pull from? Maista posted:
I would be interested in the context for this. But there's nothing wrong with including database-specific raw SQL, every codebase has that
|
|
# ¿ Jul 19, 2017 21:30 |
|
|
# ¿ May 14, 2024 10:11 |
Rake tasks shouldn't be sharing variables like that. Offload the "populates and returns a hash" parts to a `lib/my_library.rb` class
|
|
# ¿ Jul 25, 2017 23:03 |
Is anyone good at Sidekiq here? I have a deferred job on it's own queue, and I want to limit the total enqueued job for that queue to 1 at a time. some pseudocode here is what I'm trying to achieve, just not sure how to do this with the Sidekiq API: Ruby code:
edit: not thoroughly though. found one solution using the 'Stats' module like this: Ruby code:
A MIRACLE fucked around with this message at 22:07 on Sep 15, 2017 |
|
# ¿ Sep 15, 2017 21:52 |
Just wanted to post here and thank ya'll for the help over the past uhh 7 years? or so. The initial enthusiasm here for the platform inspired me to learn web development and is the primary reason I have such a kick rear end career now. Cheers yall
|
|
# ¿ Oct 3, 2017 04:10 |
Doh004 posted:Someone just got a promotion. I'm the lead/sole backend dev at a startup in LA and have been for a while, we hit first bookable revenue this month which is a nice milestone.
|
|
# ¿ Oct 4, 2017 07:18 |
Sub Par, I think I know what you're asking. you're going to want to read up on ActiveJob class inheritors and use something like Sidekiq to manage async processes Then in your controller you're going to want something like controllers/my_active_record_thing_controller.rb Ruby code:
models/my_active_record_thing.rb Ruby code:
Ruby code:
|
|
# ¿ Jan 20, 2018 01:10 |
pretty much any controller endpoint that calls an external API for the user should be async. As a rule I only do the minimum work necessary for a valid response in the endpoint, and offload everything else to worker jobs. I've allowed my app developers a `&sync=true` param for a couple endpoints if they want to wait for the data on demand, like a credit check on the current user for example. This might be bad design but I have to make concessions to the front end guys occasionally because a positive work relationship with them is a lot more important to me than adhering absolutely to REST design principles. I'm also the sole API / browser developer at my startup so I get to make these decisions and deal with the fallout (or lack thereof) down the line. So far it's been fine
|
|
# ¿ Jan 22, 2018 00:33 |
Well my startup went belly up. If anyone wants to hire me for remote or local to LA pm me. I got a decent CV and some lead / senior level experience
|
|
# ¿ Mar 2, 2018 17:11 |
Post your raw sql that’s working and I’ll try to come up with a better query Also you don’t have to do everything with ActiveRecord aliases, sometimes it’s easier and makes sense to use raw sql
|
|
# ¿ Mar 28, 2018 00:46 |
just wanna reiterate that you should be mocking pretty much everything except the bits of domain logic the unit test is specifically for. this will make your poo poo way faster
|
|
# ¿ May 5, 2018 01:41 |
Just switch to serverless everyone’s doing it
|
|
# ¿ Aug 3, 2018 19:29 |
how are the models related?
|
|
# ¿ Aug 31, 2020 16:56 |
is anyone here good at searchkick
|
|
# ¿ Oct 30, 2020 16:34 |
Peristalsis posted:I've moved a couple of partials to be rendered asynchronously with the render_async gem. They were slow loading tabs on a show page, and moving them broke tests, because (I think) the tests don't know to wait for the asynchronous tabs to finish loading. I'd like a way to continue testing these tabs. I found that RSpec/capybara is supposed to be able to render partials, but when I try that in feature tests, render is not a recognized method name. This app doesn't have dedicated controller tests, which is where I assume this is actually supposed to go, and I don't know if those allow standard UI expectations anyway. Does anyone have any suggestions for a good way to test this? post your test? is it a controller type test?
|
|
# ¿ Jan 12, 2021 01:22 |
This is the kind of thing I would hop on a screen share call for. But it’s basically you’re at the point that you need to learn the chrome or Firefox debuggers and how to set breakpoints in your front end Dm me tomorrow if you’re still having issues I can try to help
|
|
# ¿ Feb 19, 2021 02:01 |
what would it take to become a rails "expert" do y'all think. my manager wants me to become an "expert" in rails this year but I don't think he really understands what that means either, or is able to quantify it. So I have to invent some kind of metric around this to put on my evaluation for next year basically lol. I already know rails pretty dang good
|
|
# ¿ Jul 1, 2021 17:40 |
to be fair migrating 2 to 3 is a huge pain in the rear end heroku is the opposite of a pain in the rear end
|
|
# ¿ Jul 28, 2021 01:43 |
is docker sync still a thing
|
|
# ¿ Jul 28, 2021 18:22 |
I would love some more info on that... Still using docker sync on an old project and it sucks. I have to restart it constantly because it won't pick up big version changes like files being removed etc. Or it just, forgets that it's supposed to be running sometimes and I'll be racking my brain trying to figure out why the build is wonky. Big rails 4 codebase via docker-compose on a Mac edit, maybe using the nfsmount volume..? I'm gonna try some stuff today A MIRACLE fucked around with this message at 19:43 on Jul 28, 2021 |
|
# ¿ Jul 28, 2021 18:42 |
Hey y'all. I'm working on a rails app for the first time in a while, trying to remember how eager loading works while writing a map / serializer json thingy and hitting mad N+1 queries on it here's a really contrived example of what I'm trying to do Ruby code:
Ruby code:
edit... it seems like doing eager loading inside a scope doesn't work. invoking includes it outside a named scope works fine edit, I'm actually just doing it wrong A MIRACLE fucked around with this message at 23:26 on Apr 20, 2022 |
|
# ¿ Apr 20, 2022 22:56 |
post the error youre getting
|
|
# ¿ May 19, 2022 16:29 |
I have a service that is returning multiple headers with the same name and Faraday only adds one header to the response_headers per name. So it's keeping the first header and dropped the rest of them. guess I can try this in Net::HTTP
|
|
# ¿ May 31, 2023 23:09 |
I’m open to suggestions. I dug pretty deep into the gem with my debugger and can’t figure out a good place to monkey patch it. Or if I am doing it wrong. Was hoping to get it working in faraday cause I already built a whole library around it
A MIRACLE fucked around with this message at 00:34 on Jun 1, 2023 |
|
# ¿ Jun 1, 2023 00:30 |
I’m still doing rails and making good money at it. Node is good to know too, you can even cross over to .net if you want
|
|
# ¿ Oct 7, 2023 17:43 |
turbo is cool. I haven't gotten to the "stimulus" part of "hotwire" yet. is all this really better than doing a create-react-app ?Pardot posted:Is it merging them down to a single one with commas? https://github.com/lostisland/faraday/issues/1120 sorry didn't reply before but I was having trouble getting at any value in the list after the first one. and I would have been happy to split it myself but I couldn't find a way to get at a raw header value either.. I haven't had to page through okta api user lists since then but I am going to have get it working on the library sooner than later lol. might have to use the standard http lib for that request. but theres a company policy (a policy I made up) to not use other http libraries than faraday lmao. standard lib doesn't count A MIRACLE fucked around with this message at 06:23 on Nov 19, 2023 |
|
# ¿ Nov 19, 2023 06:15 |
Applied to a job at <popular rails hosting company> and got a form response rejection. Not even an HR screen? Maybe I’m slipping..
|
|
# ¿ Dec 20, 2023 21:36 |
faraday is driving me up the wall today. it was decoding and re encoding my URL params in ways that are incompatible with the API i'm calling, so I thought, ok I will try writing a custom param encoder. which it is hitting but then not respecting at all. like why does it do thisRuby code:
code:
A MIRACLE fucked around with this message at 18:53 on Feb 20, 2024 |
|
# ¿ Feb 20, 2024 18:41 |
|
|
# ¿ May 14, 2024 10:11 |
A MIRACLE posted:Applied to a job at <popular rails hosting company> and got a form response rejection. Not even an HR screen? Maybe I’m slipping.. lol just wanted to update, i guess a real person finally read my stupid markdown resume and was like when can we talk??
|
|
# ¿ Mar 29, 2024 23:45 |