The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
TinyHooks reached 1.0.0 with performance and features
The first major version of TinyHooks has been released! It’s 1.6 times as fast as ActiveSupport::Callbacks so is a great option if you’re building hooks in your own projects.
Migrating Octopress Blog to Jekyll and Serving It with Github Pages
A simple and short blog post about how to migrate an octopress blog to jekyll. Have fun! https://www.eyupatis.com/migrating-octopress-blog-to-jekyll-and-serving-it-with-github-pages/
Run all mutations in DB transactions
An easy solution to wrap all GraphQL mutations into DB in your app that uses graphql-ruby: https://railsguides.net/all-mutations-in-db-transaction-ruby-graphql/
Rails 7 transforms a Ruby hash into HTML attributes for ERB interpolation
Rails 7 added an alternate way to embed HTML attributes into ERB view [more inside]
Hanami v2.0.0.alpha2
After two years of work, presenting a revolutionary new vision for Hanami 2.0 that integrates with dry-rb & ROM. https://hanamirb.org/blog/2021/05/04/announcing-hanami-200alpha2/
Hanami App Template - Easy way to check out Hanami before release!
Hanami 2.0 is behind the corner, but in the meantime, developers were kind enough to prepare an application template, which allows us to easily test out new cool features! Here is a quick guide on how to use it! [more inside]
Introducing dry-files
A library for file system abstractions, error handling, file management, including Ruby file manipulation. It also ships with an in-memory adapter for unit tests. https://dry-rb.org/news/2021/05/04/introducing-dry-files/
Fighting the primitive obsession with Value objects
My previous post on read models intended to address something different, but I decided to focus on read model part and leave the other topic for a different one. There’s one thing which I dislike in the implementation. Using primitives to calculate the scores. [more inside]
How to build a read model with Rails Event Store Projection
Recently I faced interesting challenge in one of our customer’s application. Imagine that you take a test after which you get a personalised reports about your skills level. Existing mechanism for that was time and resource consuming. People had to wait for e-mail delivery with PDF-generated report several hours due to several constraints, which I would prefer not to dive into. [more inside]
Semantic blind spot in Ruby case statement
Mutation testing is great at semantic reduction of the code. Read on to see the case of reducing a case statement and the blind spot it discovered. [more inside]
Building a Discord bot in Ruby on Google Cloud Functions
I recently spent a weekend experimenting with the Discord API and writing a command for my church’s Discord server, all in Ruby of course. This is a series of four articles that step through the process, including setting up Discord integration, deploying the implementation to Google Cloud Functions, handling secrets and auth, and setting up an event-driven architecture. https://daniel-azuma.com/blog/2021/04/30/discord-command-in-ruby-on-google-cloud-functions-intro
Building a Questionnaire
Using StimulusJS and nested forms, we create the first parts of a questionnaire. Dynamic surveys can be difficult to architect and maintain. In this episode, we take a simple approach to creating questionnaires. https://www.driftingruby.com/episodes/building-a-questionnaire
12 Most Asked Questions About Ruby on Rails
Check out the 12 most questions asked about Ruby on Rails. Link: https://thedevpost.com/blog/12-most-asked-questions-about-ruby-on-rails/
Ruby on Rails App to manage covid vaccination in your city
Agenda Saúde is a Ruby on Rails application that has been used since last year to manage the vaccination queue of Covid-19, H1N1, and PCR tests. The project is developed by the local open-source community of Joinville, Brazil in collaboration with the city hall and local companies. [more inside]
Pushing Rails validations down to the database?
Ever open up a Rails console to debug a problem and come away wondering how the data got so funky? Despite our best efforts the database will accept plenty of garbage data if you let it. Find out how to manage it and prevent it where we can. [more inside]
Rails console trick I had no idea about
And this ain’t another .irbrc customization: [more inside]
Truemail 2.4.0 has been released 🚀 configurable plain Ruby 📨 email validator
Added ability to use MX blacklist validation. This validation layer provides checking extracted mail server(s) IP address from MX validation with predefined by user blacklisted IP addresses list. It can be used as a part of DEA (disposable email address) validations. Be sure that email address valid and exists. https://github.com/truemail-rb/truemail