Ruby On Rails

tosbourn,
@tosbourn@masto.ai avatar

I’m working on a project that has some memory issues with their jobs.

Used a memory profiler, one job made just over 1,000,000,000 memory allocations (billion, with a b!)

I’ve my work cut out, but I think I’m gonna learn a tonne about memory best practice

#RubyOnRails #Performance #MemoryUsage

alexanderadam,

@tosbourn cool, thank you!
Will you ping me once you did? 🥹

tosbourn,
@tosbourn@masto.ai avatar

@alexanderadam I will!

testdouble,

Do you know a top-notch Ruby on Rails or C# developer?

We're hiring subtractors!

💚 Our mission is to improve the way the world builds software. We care about things like testing best practices, maintainability, and scalability.

✨ We're fully remote and looking for subcontractors across the U.S. and Canada.

oz,
@oz@mastodonsweden.se avatar

My old man trait is that I think SQL is easier to read and work with than arel, active record et al. Unless you're making libraries, just write the damn query. #rubyonrails #ruby #sql #PostgreSQL #php #mariadb

anianimalsmoe, (edited )
@anianimalsmoe@sakurajima.moe avatar

I had to do this to go poke the Mastodon beast. Online tutorials were insufficient for the depths I need to hack this code.

anianimalsmoe,
@anianimalsmoe@sakurajima.moe avatar

@PrimaveraZY
Train derailed instead

PrimaveraZY,

@anianimalsmoe I blame the cat

tosbourn,
@tosbourn@masto.ai avatar

I need to get better at doing this, but you can write comments for database tables and columns from your Rails migrations.

Hat tip to @davetron5000's Sustainable Web Development book where I first learned of this!

https://tosbourn.com/comment-your-rails-migrations/

jaygooby,
@jaygooby@mastodon.social avatar

@tosbourn @davetron5000 Thanks for this! This is very much 🤯 for me, and dead useful atm, whilst looking at legacy codebase and technical debt. I spy a whole load of comment migrations coming to a DB near me, real soon

tosbourn,
@tosbourn@masto.ai avatar

@jaygooby very happy to help!

mroach,
@mroach@mas.to avatar

There's a story of developer (me) having a no good very bad morning because of this loaded gun that Rails leaves on the table.

Just imagine you're fixing some production data and you accidentally type User.update instead of user.update and realise you just updated not one, but every single record in the database with the same value.

Also, thank goodness for PostgreSQL point-in-time database restoration 😓
(I updated a field excluded from audit logs, of course)

tosbourn,
@tosbourn@masto.ai avatar

@mroach oh wow. I’m surprised I’ve never shot myself with this! Thanks for sharing.

railsconf,

Don't get caught up Schitt's Creek! You got this!! And the community is here to support you the entire way.

Submit your CFP proposal(s) by Feb 13 | https://buff.ly/42CbaQg

#railsconf #cfp #railsdevelopers #rubyonrails

video/mp4

Floppy,
@Floppy@mastodon.me.uk avatar

Anyone know how to run an arbitrary command at the start of the asset pipeline process? I want to hook in to build an included javascript file on the fly, but my search-fu is completely failing me...

rgarner,
@rgarner@mastodon.social avatar

@Floppy but do consider scaling to a proper esbuild.config.js as per my previous Massive Gist; this stuff can only live in package.json for so long before the interdependencies get out of hand

Floppy,
@Floppy@mastodon.me.uk avatar

@rgarner thank you mate, much appreciated! I will parse it at some point. Fortunately my JS package is pretty simple at the moment.

chrisc,

SaturdayMP Show : Adding Basic Auth to NGINX Passenger Docker (Part 2)

https://youtu.be/i0W_3Q55gro

In this episode I get the Basic Authentication NGINX configuration working using the envsubst tool to replace environment variables in the config file.

Question you want answered in a future video? Pair on a problem? Constructive feedback? DM me or email ask@saturdaymp.com.

chrisc,

@steadmanticore I forgot to ask in my previous message if you know of any good alternatives to Basic Auth?

steadmanticore,

@chrisc I love basic auth. With SSL everywhere now, I think it works great for something dev-facing.

I don't Ruby much, but I've used flask-login in the past for something minimalistic and simple

ianbradbury,
@ianbradbury@considerate.social avatar

Today is a “rails new” day!
Scared and excited all at the same time.
Ruby and gems all up to date..... here I go……

ianbradbury,
@ianbradbury@considerate.social avatar

@AGMS00 - new project. It’s been so long since I last ran that command that I’ve spent some hours reading all the new options.

AGMS00,
@AGMS00@ruby.social avatar

@ianbradbury Gah, will be doing the same for a new Nginx build - see what makefile options are new and figure out what features to turn off.

bikemonterey,
@bikemonterey@sfba.social avatar

California Bicycle Coalition / #CalBike 2024 Summit Advance Session "Success Stories from San Diego" included a presentation by Bike SD's ED Anar Salayev. He referred to importance of recognizing needs of small businesses while advocating for changes that make streets safer for people who bike & walk.

One idea he mentioned: small-business discount programs. @ 29:50 https://youtu.be/pPxwq0fs1xY?si=neFweJcmoT7isBI7&t=1790

In 2009 we launched such a program in #MontereyCounty; it remains in place, although impacted by pandemic, as well as by need for #RubyOnRails support. (As with all #Bicycling #Monterey projects https://bikemonterey.org/about/financial-donations/donations-some-ways-your-money-can-help, we've done all HER Helmet Thursdays work as a volunteer 2009-2023.) Hear 1-min audio on the project's 10th anniversary & watch 2-min KSBW video intro https://bikemonterey.org/her-helmet-thursdays.

Similar programs in USA, i.e., Long Beach, CA & New York, NY: https://bikemonterey.org/wp-content/uploads/Discounts-when-people-bike-US-sampling-1.pdf

#BikeTooter #Sustainable #Economy #Environment #CarbonEmissions #ActiveTransportation #transportation #CompleteStreets #UrbanExploration

masukomi,
@masukomi@connectified.com avatar

/ / geeks: do any of you have any pointers for making an interpreted language webapp be able to update itself like a native app?

Has anyone made a library for handling this smoothly (in any lang)?

jsalvador,
@jsalvador@mastodon.social avatar

@masukomi Basically this is the point of Kubernetes and Helm. But implies a not-so-basic architecture design.

Let me find something for you to ilustrate this concept :)

masukomi,
@masukomi@connectified.com avatar

@jsalvador thanks.

a) i'm not a k8s / Helm / Docker person (not really any DevOps)

b) I keep going "yeah, but the install is behind a firewall you can't access" and i felt that those were more "push" than "pull" solutions.

wood,
@wood@hachyderm.io avatar

How can we unify the Rails community?

thomasfuchs,
@thomasfuchs@hachyderm.io avatar

@wood Well, there's one obvious thing to do to begin to heal it.

wood,
@wood@hachyderm.io avatar

@thomasfuchs yeah. The chances of that happening seem low.

masukomi, (edited )
@masukomi@connectified.com avatar

There is some atypically good stuff in the latest point release (7.1). https://rubyonrails.org/2023/10/5/Rails-7-1-0-has-been-released

like, the kind of notable new features that Apple would be all "hold onto that for the next WWDC!" instead of "just add it to the point release"

The Docker stuff is, for me, especially gratitude engendering.

🙇‍♀️ major thanks to the folks who contributed to make this happen: @eileencodes , @tenderlove, and all the others.

[edit: forgot to include the announcement link]

masukomi,
@masukomi@connectified.com avatar

@darkunicorn will do so this weekend (hopefully). Thanks. :D

darkunicorn,

@masukomi Sounds great! Please share your insights. 🙂

ldodds, (edited )
@ldodds@mastodon.me.uk avatar

There's still time to apply for a role in my team at EnergySparks

https://energysparks.uk/jobs/1/inline

Looking for a remote, UK based ruby/rails developer to help us build and scale the product.

Small, friendly motivated team working on a rich, data-driven product to help schools save money and teach kids about climate change.

Interesting engineering work in a role that matters.

[Role now filled, thanks!]

tosbourn,
@tosbourn@masto.ai avatar

Any folk know any decent open source Rails projects that use Active Storage?

Want to see how other folk deal with it... not being amazing 🙃

tosbourn,
@tosbourn@masto.ai avatar

People who know Rails better than me, why does this catch all not work for OPTIONS / or POST /, when it does work for OPTIONS /blah or POST /lol

match '*url' => 'errors#not_found', via: :all  

Slightly more info here (and if you happened to upvote it, well, that would be swell!)

https://stackoverflow.com/questions/76850372/how-to-fix-rails-no-route-matches-post-or-option-for-the-root-url

tosbourn,
@tosbourn@masto.ai avatar

Had someone say I could specifically do a match '/'.. via: :all which will work, but I would have thought the original catchall (above) should work.

tosbourn,
@tosbourn@masto.ai avatar

Was checking some large open source projects (like the Mastodon codebase) and it seems like this is a common pattern.

I'd still like to know why the match * actually means match /*. Started digging through the Rails codebase but I think I need to spend some proper thinking time on it, which I don't have right now!

rahoulb,
@rahoulb@ruby.social avatar

I wrote about why is no longer the best choice for writing web applications (and it's not even anything to do with DHH): https://theartandscienceofruby.com/p/end-of-the-rails

leanpub,
@leanpub@mastodon.social avatar

The Rails 7 Way by Lucas Dohmen, Tom Henrik Aadland and Obie Fernandez is on sale on Leanpub! Its suggested price is $40.00; get it for $24.50 with this coupon: https://leanpub.com/sh/6v1zu0uh

tosbourn,
@tosbourn@masto.ai avatar

Here is a real beginner friendly guide to migrations in Ruby on Rails.

If you've been doing Rails for any length of time, this probably isn't a post for you.

If you are new to Rails, or the concept of migrations, it will hopefully be useful!

https://tosbourn.com/what-are-rails-migrations/

tosbourn,
@tosbourn@masto.ai avatar

Why and how to set a not null constraint on a Rails database column.

https://tosbourn.com/force-null-constraint-rails/

changelog,
@changelog@changelog.social avatar

Parker Selbert may be biased... but he strongly believes that Elixir is the best language there is for web dev 👇

https://youtu.be/blh1k6T0Qhk

tosbourn,
@tosbourn@masto.ai avatar

I think I’ll have an extra day a week fairly soon if anyone has a Toby-shaped gap they’d like to see filled.

Particularly interested in the dull maintenance tasks your web team never has time or capacity to address.

a specialty, but I can turn my hand to lots of things.

leanpub,
@leanpub@mastodon.social avatar

Gradual Modularization for Ruby and Rails: Improve collaboration, system design, and flexibility https://leanpub.com/package-based-rails-applications by Stephan Hagemann is the featured book on the Leanpub homepage! https://leanpub.com #RubyOnRails #SoftwareEngineering #SoftwareArchitecture #ComputerProgramming #Ruby

  • All
  • Subscribed
  • Moderated
  • Favorites
  • rubyonrails
  • DreamBathrooms
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • GTA5RPClips
  • JUstTest
  • tacticalgear
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • ethstaker
  • anitta
  • provamag3
  • Leos
  • cisconetworking
  • megavids
  • lostlight
  • All magazines