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.
last mile and Gemfile.lock
If you are responsible for an application, a last-mile application, not a library (a gem), please check in your Gemfile.lock. Updating your dependency gem versions is something you do deliberately, under the cover of your test suite.
How to Speed Up Your Tests via :build_stubbed
Learn how to speed up your test suite using build_stubbed. This approach works well when you test models or services. [more inside]
Is Your Rails Team Slowing Down? Here's Why, And What You Can Do About It
Do any of these statements resonate? [more inside]
Ruby ♡ Unicode
What is a character in Unicode? What are, and how to use the Unicode case-mapping and normalization algorithms in Ruby? How to detect emoji in text? What is the difference between invalid codepoints and non-characters? Answers to all those questions might be found in Idiosyncratic Ruby Episode 66: Ruby has Character
Simple, Async, Map/Reduce queue for Ruby
How DNSimple implemented parallel requests in near real-time with a simple Ruby queue. https://blog.dnsimple.com/2018/05/simple-async-map-reduce-queue-for-ruby
Setting up a BDD Stack on a Rails 5 Application
An excerpt from Rails Testing Handbook, this post shows how to practically get started with behavior-driven development (BDD). We generate a new Rails 5 application with all the necessary tools, including RSpec and Cucumber, and get to the first green CI build. Read tutorial →
JsonschemaSerializer: turn your ActiveRecord models into json schemas
Have you ever considered to serialize your ActiveRecord models into valid jsonschema? You can get easily and for free thanks to this gem for jsonschema serialization. The first stable release of jsonschema_serializer is out and I would love to receive your feedback, feature or pull requests!
Why Do We Use Nil?
In this article we explore why do we use nil, the problems with nil & type checking, and what to do about it. https://www.rubyguides.com/2018/05/why-do-we-use-nil/
An Open Source Data Dictionary for Cities in RoR5 + React
As Cities start working through the ‘What Works Cities’ program, you quickly come upon the requirement to build a ‘data dictionary’. Looking around, everything looked like some variation of a spreadsheet, but I wanted to something that would help visualize and surface the data relationship between our myriad applications. [more inside]
Arel with Wharel
Wharel is a tiny little gem that uses the empty room pattern to make Arel queries easier to build. In this blog post, I walk through all 31 lines of this tiny gem and the features of Ruby’s object model that make it so simple and powerful.
Make your large number literals readable
If you’re new to Ruby from another language, you might not know about the features it has for formatting large literal numbers readably. Here’s a refresher in the form of a 45-second screencast!
Build a chat app with Ruby on Rails
In this tutorial, we’ll explore how to create a live chat system in Ruby while leveraging on the awesome features of Pusher Channels.
Ruby's magical Enumerable module
It’s time for another episode of Ruby Magic! In issue #13, we’ll look at one of Ruby’s most magical features, which provides most of the methods you’ll use when working with Ruby’s enumerable classes like Array, Hash and Range. We’ll learn about the Enumerable module and the Enumerator class, and we’ll make our own object enumerable by implementing #each from scratch. https://blog.appsignal.com/2018/05/29/ruby-magic-enumerable-and-enumerator.html
TestProf II: Factory therapy for your Ruby tests
Vladimir Dementyev in an article for Evil Martians’ blog continues presenting his doctor bag full of diagnostic and optimization tools for tests: TestProf. This time, the focus is on factories: how they can slow down your RSpec and Minitest testing suites, and what can be done about it.
Building a Rails 5 JSON-based API? Easily transform incoming and outgoing JSON keys
API clients send and receive camelCase formatted keys. Your Ruby API code uses snake_case keys. Just add this gem: json_key_transformer_middleware
Conditional execution with DSL in Ruby
Replace if’s or exceptions with DSL: https://railsguides.net/conditional-execution-with-dsl/
Nice SQL prettifier for ruby
Nice SQL prettifier for ruby: https://github.com/alekseyl/niceql [more inside]
How to add Material UI to your Rails + React App
Add Material UI to your Rails + React App! [more inside]
Async Reverse Geocoding with Ruby and Geocoder
Reverse geocoding using the Geocoder gem. https://reinteractive.com/posts/354-best-practices-async-reverse-geocoding-with-ruby-and-geocoder
The Case for before_validation Callback: Complex State Normalization
A few months ago I wrote a blog post about ActiveRecord before_validation callback and how it is used for wrong reasons and concluded that in most cases this is not something we should be using routinely. However, I missed one appropriate use case for it which might be quite common in Rails apps, so this might be an excellent opportunity to get back to before_validation callback and show its other side. [more inside]
Spina CMS 1.0 released
After more than 3 years we are releasing Spina CMS 1.0! [more inside]
Zero downtime migration from Enum to Single Table Inheritance
Interested in migrating existing application architecture from Rails enum to single table inheritance, without users experiencing any downtime? This post details strategies for planning and implementing a successful architecture refactor. [more inside]
How to replace jQuery with Vue.js in Ruby on Rails apps
Ever wanted to switch from JQuery to Vue.js? Check out how in this article