Saeloun Blog

https://blog.saeloun.com/

Ruby on Rails and ReactJS consulting company. We also build mobile applications using React Native

フィード

記事のアイキャッチ画像
Upgrading from Rails 5.2 to Rails 6 - Modern Rails Features
Saeloun Blog
Rails 6 is a major milestone that modernizes Rails for the 2020s.The biggest change?Zeitwerk autoloader replaces the classic autoloader, requiring careful attention to file naming conventions.Plus: Webpacker as default, multiple database support, parallel testing, Action Mailbox, and Action Text.Note: This is Part 3 of our Rails Upgrade Series. Read Part 1: Planning and Part 2: Rails 4.2 to 5 first.Before We StartExpected Timeline: 2-4 weeks for medium sized applicationsMedium-sized application: 20,000-50,000 lines of code, 30-100 models, moderate test coverage, 2-5 developers. Smaller apps may take 1-2 weeks, larger enterprise apps 6-12 weeks.Prerequisites:Currently on Rails 5.2 (upgrade from 5.0/5.1 first)Ruby 2.5.0+ installed (Ruby 2.6 or 2.7 recommended)Test coverage of 80%+Understanding of app’s file structureRuby Version RequirementsRails 6 requires Ruby 2.5.0 minimum, but we strongly recommend Ruby 2.6 or 2.7 for production.Ruby Version FeaturesRuby 2.5 (December 2017):yield_sel
2日前
記事のアイキャッチ画像
What Is New In Ruby 4.0
はてなブックマークアイコン 1
Saeloun Blog
Ruby 4.0 is here, releasing on Christmas Day 2025, marking 30 years since Ruby’s first public release.This release packs some genuinely exciting features.Let’s explore the most impactful changes in Ruby 4.0.ZJIT - A New JIT CompilerRuby 4.0 introduces ZJIT, a new just in time compiler built by the same team behind YJIT.Unlike YJIT’s lazy basic block versioning approach, ZJIT uses a more traditional method based compilation strategy.The key difference?ZJIT is designed to be more accessible to contributors.It follows a “textbook” compiler architecture that’s easier to understandand modify.To enable ZJIT, we can use the --zjit flag:ruby --zjit my_script.rbWhile ZJIT is faster than interpreted code, YJIT remains the recommended choice for production.ZJIT sets the foundation for future performance improvementsand community contributions.Ruby::Box - Isolated NamespacesRuby::Box is an experimental feature that brings isolated namespaces to Ruby.This allows us to load multiple versions of a li
4日前
記事のアイキャッチ画像
Upgrading from Rails 4.2 to Rails 5 - A Complete Guide
Saeloun Blog
Rails 5 brought major improvements: ActionCable for WebSockets, API mode, Turbolinks 5, and ActiveJob integration.But it also introduced breaking changes that require careful migration.If we’re still on Rails 4.2 (EOL since 2016), this upgrade is critical for security and performance.Let’s walk through the key changes and how to handle them.Note: This is Part 2 of our Rails Upgrade Series. Read Part 1: Planning Rails Upgrade for strategic planning guidance.Before We StartExpected Timeline: 2-4 weeks for medium-sized applicationsMedium-sized application: 20,000-50,000 lines of code, 30-100 models, moderate test coverage, 2-5 developers. Smaller apps may take 1-2 weeks, larger enterprise apps 6-12 weeks.Prerequisites:Test coverage of 80%+Ruby 2.2.2+ installed (Ruby 2.3+ recommended)Backup of production databaseStaging environment for testingRuby Version RequirementsRails 5 requires Ruby 2.2.2 minimum, but we strongly recommend Ruby 2.3 or 2.4 for production.Why Upgrade Ruby First?Ruby 2.
9日前
記事のアイキャッチ画像
Rails 8.1 Introduces Structured Event Reporting with Rails.event
Saeloun Blog
IntroductionModern observability platforms thrive on structured data.They can parse JSON, extract fields, build dashboards,and alert on specific conditions.But Rails has traditionally given us Rails.logger,which produces human readable but unstructured log lines.Parsing these logs for analytics is painful.We end up writing regex patterns,hoping the log format doesn’t change,and losing valuable context along the way.Rails 8.1 introduces a first class solution:the Structured Event Reporter,accessible via Rails.event.BeforeBefore this change,logging in Rails meant working with unstructured text.Rails.logger.info("User created: id=#{user.id}, name=#{user.name}")This produces a log line like:User created: id=123, name=John DoeTo extract meaningful data from this,observability tools need to parse the string.If we change the format slightly,our parsing breaks.We also lack consistent metadata.Where did this log come from?What request triggered it?What was the timestamp with nanosecond precisio
10日前
記事のアイキャッチ画像
Rails 8.1 introduces bin/ci to standardize CI workflows with a new DSL
Saeloun Blog
Rails 8.1 introducesbin/ci to standardize CI workflows based on a new domain specific language (DSL)in config/ci.rb making it easier to define,run and maintain the CI pipelines.Understanding the DSL in config/ci.rbThe new DSL allows us to define CI steps in a structured and readable way.step: Defines a single step in the workflow. The first argument is the step’s name and the remaining arguments form the command to execute.success?: Returns true if all previous steps passed, allowing conditional logic.failure: Displays a failure message with a description when the workflow fails. Takes two arguments: the message and a description.CI.run do step "Setup", "bin/setup --skip-server" step "Style: Ruby", "bin/rubocop" step "Security: Brakeman code analysis", "bin/brakeman", "--quiet", "--no-pager", "--exit-on-warn", "--exit-on-error" step "Security: Importmap vulnerability audit", "bin/importmap", "audit" step "Tests: Rails", "bin/rails", "test", "test:system" step "Tests: Seeds", "env RAILS
11日前
記事のアイキャッチ画像
Planning Rails Upgrade - A Strategic Guide
Saeloun Blog
Rails upgrades can feel daunting due to breaking changes, gem compatibility issues and potential downtime.But staying on outdated versions is riskier.Security vulnerabilities accumulate, performance suffers,andwe miss powerful features that make development easier.With proper planning, Rails upgrades can be smooth and predictable.This five part series shares proven strategies from dozens of successful upgrades.Why Upgrade Now?Let’s look at the current Rails ecosystem (as of December 2025):Rails 8.x: Early adoption phase (~5% of applications)Rails 7.x: ~40% of active applicationsRails 6.x: ~35% of applicationsRails 5.x and older: ~20% still runningRails 8 was released in November 2024, so adoption is still ramping up.If we’re on Rails 6 or earlier, we’re not alone—but we should plan our upgrade path.The Real Cost of WaitingSecurity: Rails 4.2 reached EOL in 2016. Ruby 2.7 reached EOL in March 2023. No security patches means real vulnerability.Performance: Ruby 3.3 with YJIT (supported b
16日前
記事のアイキャッチ画像
Accessibility Best Practices for Consultancy Websites
Saeloun Blog
A good website doesn’t just look nice, it works for everyone. Accessibility ensures that all users, including those with disabilities, can easily browse, understand, and interact with your site.For consultancy websites, accessibility also builds trust. It shows professionalism, attention to detail, and a genuine commitment to inclusivity.Why Accessibility MattersWhen a consultancy site is accessible, it sends a clear message: you care about people and their experience. It’s not only the right thing to do but also good for business.Here’s why accessibility matters:Wider reach. Millions of users rely on assistive technologies such as screen readers or voice navigation.Better usability. Accessibility improvements often make the site easier for everyone, not just people with disabilities.Stronger SEO. Search engines favor clear structure, proper headings, and readable content.Legal compliance. Many regions require digital accessibility by law. Following best practices helps you stay compli
16日前
記事のアイキャッチ画像
Rails Native Composite Primary Keys: A Complete Evolution from Rails 3 to Rails 8
Saeloun Blog
IntroductionComposite Primary Keys (CPKs) are one of those “real world engineering” features that frameworks eventually grow into. Many enterprise databases, analytics systems, geographic indexes, and ledger tables naturally model identity using more than one attribute.For years, Rails avoided this space and assumed a single integer column called id, and our applications were expected to adapt with Rails 8, this is finally changing. The framework now understands identity that is multi column, not just “one number per record”.Even more interesting: Rails does this without requiring external gems, and without asking us to break conventions everywhere. The feature is still maturing, but its foundations are strong enough that we can start building real systems on top of it.In this post, we walk through the full Rails journey where we came from, why this matters, how to use the new API, and how to migrate from gem based systems to native CPK support thoughtfully.A Brief History of Identity
18日前
記事のアイキャッチ画像
A Guide to Web Application Monitoring
Saeloun Blog
Web application monitoring is the nervous system for our software—continuously listening, collecting signals, and analyzing them to catch problems before they become outages. A one-hour outage can cost millions.Amazon lost an estimated USD 34 million in 2021, while Meta lost close to USD 100 million in a similar incident. Effective monitoring moves our team from reactive firefighting to proactive fire prevention.The Four Pillars of TelemetryModern applications are complex, distributed systems with dozens of moving parts. Without visibility into what’s happening inside, we’re flying blind. Monitoring solves this by collecting four types of telemetry data:1. Metrics: The Vital SignsMetrics are numeric measurements taken at regular intervals—response time, error rate, CPU usage, and throughput. They’re cheap to store and fast to query, making them perfect for dashboards and alerts.2. Logs: The Detailed NarrativeWhile metrics tell us what happened, logs tell us why. When a 500 Internal Ser
24日前
記事のアイキャッチ画像
Non‑Blocking IO.select in Ruby: Introduction to Fiber::Scheduler#io_select
Saeloun Blog
IntroductionRuby 3.1 introduced Fiber::Scheduler#io_select, making IO.select work seamlessly with fiber-based concurrency. Before diving in, let’s clarify some key concepts.What’s a Fiber?A fiber is a lightweight, pausable unit of execution in Ruby. Unlike threads, fibers don’t run in parallel—they cooperatively yield control to each other, making them predictable and efficient for I/O-bound tasks.fiber = Fiber.new do puts "Starting" Fiber.yield # Pause here puts "Resuming"endfiber.resume # => "Starting"fiber.resume # => "Resuming"What’s a Scheduler?A scheduler manages when fibers run. When a fiber performs I/O (like reading from a socket), the scheduler pauses it and runs other fibers instead of blocking. This enables non-blocking I/O without callbacks or threads.Popular schedulers include the Async gem, which powers the Falcon web server.Real-World ExampleImagine building a web scraper that fetches 100 URLs. With traditional blocking I/O, you’d wait for each request sequentially. Wit
25日前