Gem from a private Gitlab repository in your Gemfile(for Docker)
Gem from a private Gitlab repository in your Gemfile(for Docker)
If you want to deploy your Ruby on Rails project with Kamal, and your project depends on a Gem hosted in a private GitLab repository,
Dockge – Beautiful, Fancy, Easy-to-Use Docker Compose Manager
Dockge – Beautiful, Fancy, Easy-to-Use Docker Compose Manager
Today I discovered a fantastic tool for managing my Docker containers based on docker-compose.yml files — it’s called Dockge.
Dockge isn’t just another wrapper around Docker — it genuinely impressed me. It has a beautiful, modern interface, works fast, and most importantly, makes it super easy to start, stop, and monitor services in a stack. Some highlights:
RubyMine and Cursor AI Synchronisation
RubyMine and Cursor AI Synchronization
At the time of writing, AI integration in RubyMine is still lacking.
As a workaround, we can use two tools in tandem:
- RubyMine – a powerful and full-featured IDE
- Cursor AI – an additional editor enhanced with AI capabilities
To make this setup efficient, it would be great to synchronize these tools.
For example, when we open a file in RubyMine, the same file could also be opened automatically in Cursor AI.
Conditional Routing in Rails: Cleanly Split Controllers by Query Parameter
Conditional Routing in Ruby on Rails Using Custom Constraints
In complex Ruby on Rails applications, it’s common to route requests based on dynamic conditions, such as the value of a query parameter. One powerful way to handle such cases is to use custom routing constraints. This article demonstrates how to route the same endpoint to different controllers based on the subject_type
parameter.
Problem
Suppose we want to handle updates to details of various animal types—dogs, cats, and mice—through a single endpoint like:
Hidden Performance Trap in Rails: Avoid nil in .where(id: [...])
⚠️ Why Including nil
in .where(id: [...])
Can Severely Impact PostgreSQL Performance
When writing queries like:
How to Add RuboCop Checking for Your Ruby Project in GitLab CI
How to Add RuboCop Checking for Your Ruby Project in GitLab CI
RuboCop is a Ruby static code analyzer and formatter that helps maintain consistent code style and catch potential issues. Integrating it into your GitLab CI pipeline ensures that all code changes meet your project’s quality standards before merging.
What is RuboCop?
RuboCop is a Ruby gem that:
- Enforces Ruby style guide conventions
- Detects potential bugs and code smells
- Provides automatic code formatting
- Integrates with popular editors and CI systems
- Supports custom rules and configurations
Prerequisites
Before setting up RuboCop in GitLab CI, ensure you have: