ShakaCode blog - rails

Search
RailsConf 2021 -- Implicit to Explicit: Decoding Ruby's Magical Syntax - read more
StarFeatured

RailsConf 2021 -- Implicit to Explicit: Decoding Ruby's Magical Syntax

Does a Rails model or config file seem like a magical syntax? Or can you read any Ruby code and understand it as the interpreter does?

11 Apr 2021Dotby Justin Gordon
Rails 7.1 allows using aliased attributes with insert_all and upsert_all

As of Rails 7.1, you can utilize aliased attributes when employing the insert_all and upsert_all methods.

6 Dec 2023Dotby Alkesh Ghorpade
Rails 7.1 adds ActiveRecord::Base::generates_token_for

In Rails 7.1, ActiveRecord::Base::generates_token_for provides a convenient way to generate and validate tokens for various use cases in Rails applications.

5 Dec 2023Dotby Alkesh Ghorpade
Rails 7.1 allows passing options to ActiveRecord explain

Rails 7.1's explain method now accepts options for more detailed query insights.

29 Nov 2023Dotby Alkesh Ghorpade
Rails 7.1 adds support for multiple-column ordering in Activerecord

Rails 7.1 supports multiple-column ordering for find_each, find_in_batches and in_batches.

28 Nov 2023Dotby Alkesh Ghorpade
Rails 7.1 adds the ability to autoload the lib directory

Rails 7.1 introduces the autoload lib method and allows one to pass the option :ignore to avoid subdirectories that should not be autoloaded.

22 Nov 2023Dotby Alkesh Ghorpade
An introduction to test suite optimization in Ruby

Going over some common pitfalls that might be making your tests slower than they need to be, and what to do about them.

21 Nov 2023Dotby Samuel de Moura
Flaky Visual Regression Tests, and what to do about them

Let's go over some tips about what to do when your visual regression tests are failing intermittently for no apparent reason.

16 Nov 2023Dotby Samuel de Moura
Rails 7.1 limits the maximum length of auto-generated index names

Rails 7.1 defines a 62-byte maximum limit for auto-generated index names.

14 Nov 2023Dotby Alkesh Ghorpade
Rails 7.1 adds an option to extract the sample rate of an audio file

In Rails 7.1, leverage ActiveStorage::AudioAnalyzer to extract an audio file's sample rate, bit rate, and duration.

8 Nov 2023Dotby Alkesh Ghorpade
Rails 7.1 allows ErrorReporter to handle several error classes

With Rails 7.1, you can use the Rails.error.handle method to deal with multiple error classes.

7 Nov 2023Dotby Alkesh Ghorpade
Rails 7.1 adds support for infinite ranges for LengthValidators

With Rails 7.1, you can pass an infinite range to the :in/:with options of length validators.

31 Oct 2023Dotby Alkesh Ghorpade
Rails 7.1 expands its support for ActiveRecord asynchronous queries

With Rails 7.1, you can execute the aggregate queries asynchronously.

30 Oct 2023Dotby Alkesh Ghorpade
Rails 7.1 raises an error on generating model attributes with dangerous name

In Rails 7.1, generating a model with attributes named keywords like hash or save would raise an error.

27 Oct 2023Dotby Alkesh Ghorpade
Rails 7.1 adds validation to enums

With Rails 7.1, if you want to validate the enum values before saving, use the option `:validate`.

26 Oct 2023Dotby Alkesh Ghorpade
Rails 7.1 allows matching exception messages to assert_raises assertion

In Rails 7.1, you can now use a single assert_raises assertion to match both the exception class and the message.

25 Oct 2023Dotby Alkesh Ghorpade
Rails 7.1 adds Object#with method

Rails 7.1 implements object#with as a method that allows you to set and restore public attributes around a block.

24 Oct 2023Dotby Alkesh Ghorpade
Rails 7.1 allows attaching file or pathname to has_one_attached

With Rails 7.1, users can attach a file or pathname directly to has_one_attached associations. This makes it easier to attach files already stored on the filesystem.

23 Oct 2023Dotby Alkesh Ghorpade
Rails adds the ability to pass the expires_at option to ActiveStorage::Blog#signed_id

The expires_at option for ActiveStorage Blob signed IDs allows you to specify when the signed ID will expire. This can be useful for sharing sensitive files or files you don't want publicly accessible forever.

20 Oct 2023Dotby Alkesh Ghorpade
Metaprogramming in Ruby

Explore about metaprogramming in Ruby and how to use it.

rubyDot
19 Sep 2023Dotby Alkesh Ghorpade
Rails 7.1 gives templates more control over the locals they receive

Rails 7.1 introduces an option that enables templates to have required arguments with default values.

13 Sep 2023Dotby Alkesh Ghorpade
Rails 7.1 makes it possible to execute tests for a given range of lines in a file

In Rails 7.1, you can execute tests for a given range of lines (a-b) by passing the range to the test command.

6 Sep 2023Dotby Alkesh Ghorpade
Rails 7.1 removes the secrets:setup command and deprecates secrets:edit and secrets:show commands

Rails 7.1 removes the deprecated setup command of secrets and adds a deprecation warning for secrets edit and show commands.

5 Sep 2023Dotby Alkesh Ghorpade
Rails 7.1 makes increment_counter and decrement_counter accept a by argument

In Rails 7.1, the increment_counter and decrement_counter methods can now be passed an argument to increment or decrement the counter by any value.

31 Aug 2023Dotby Alkesh Ghorpade
Shakapacker 7

Shakapacker, Webpacker's official successor, is a Ruby gem that integrates webpack into Ruby on Rails. Version 6 had references to both webpacker and shakapacker, but with version 7, Shakapacker is now entirely Shakapacker.

30 Aug 2023Dotby Mostafa Ahangarha
Rails 7.1 adds support for Array#intersect? to ActiveRecord::Relation

In Rails 7.1, the Array#intersect? method can be used to find if two ActiveRecord::Relation objects intersect or not.

22 Aug 2023Dotby Alkesh Ghorpade
Rails 7.1 adds the ability to raise errors on missing callback actions

In Rails 7.1, you can now configure your controllers to throw an error if the only or except options in controller callbacks refer to actions that don't exist. This helps detect and fix typos and other mistakes in your controller code.

9 Aug 2023Dotby Alkesh Ghorpade
Rails 7.1 adds the ability to defer the unique constraints in PostgreSQL

With Rails 7.1, you can delay the unique constraints check using the deferrable option.

8 Aug 2023Dotby Alkesh Ghorpade
Rails 7.1 enhances PostgreSQL enum functionality

Rails 7.1 adds rename_enum, add_enum_value and rename_enum_value commands to DB migration extending support for PostgreSQL enums.

2 Aug 2023Dotby Alkesh Ghorpade
Normalize Data with Rails 7.1

Rails 7.1 adds ActiveRecord::Base::normalizes method to standardize the data before saving it to the database.

1 Aug 2023Dotby Alkesh Ghorpade
Rails 7.1 adds --parent option to the controllers

Rails 7.1 controller generator accepts the --parent option. It allows to generate a controller that inherits from the specified parent controller.

26 Jul 2023Dotby Alkesh Ghorpade
Rails 7.1 adds picture_tag helper to support HTML5 picture element

Rails 7.1 adds the picture_tag helper method that renders the HTML picture tag for handling responsive images.

25 Jul 2023Dotby Alkesh Ghorpade
Rails 7.1 adds routes --unused option to detect extraneous routes

Discover extraneous routes in your Rails application effortlessly by utilizing the --unused option with the rails routes command.

19 Jul 2023Dotby Alkesh Ghorpade
Rails 7.1 adds ActiveJob#perform_all_later to enqueue multiple jobs at once

Rails 7.1 adds perform_all_later to ActiveJob that enqueues many jobs at once, eliminating repeated Redis roundtrips.

18 Jul 2023Dotby Alkesh Ghorpade
Rails 7.1 introduces deliver callbacks for ActionMailer

Rails 7.1 adds before_deliver and after_deliver callbacks to ActionMailer to hook into the lifecycle events of the mail delivery.

11 Jul 2023Dotby Alkesh Ghorpade
Rails 7.1 makes ActiveRecord query cache an LRU

With Rails 7.1, the ActiveRecord query cache uses the LRU strategy and removes the least recently used queries.

5 Jul 2023Dotby Alkesh Ghorpade
Manage Rails app business logic using ActiveInteraction gem

Let's dive into managing Rails application-specific business logic using ActiveInteraction.

29 Aug 2020Dotby Alkesh Ghorpade
RailsConf 2020 -- Webpacker, It-Just-Works, But How?

How does the Webpacker gem provide "it-just-works" webpack integration with Rails? That simplicity did not come easily. The rich functionality, complexity, and rapid evolution of the webpack ecosystem necessitated extension points beyond a simple Ruby config file.

5 May 2020Dotby Justin Gordon
Introduction to Cypress on Rails

Cypress provides really powerful tools to create true end-to-end tests for modern web applications. With these testing features, stay 100% confident that all frontend user interactions, even async requests, work as expected.

26 Dec 2019Dotby Anton
Enums and Queries in Rails 4.1, and Understanding Ruby

Understanding Ruby and how enums work in Rails 4.1.

22 Oct 2014Dotby Justin Gordon
Storing or Excluding Node Modules in Rails Git Repositories

Should you store your node_modules in your git repository or configure git to ignore the node_modules directory.

28 Sep 2014Dotby Justin Gordon
Pry, Ruby, Array#zip, CSV, and the Hash[] constructor

Example showing how pry demonstrates the usefulness of Array#zip with CSV

15 Sep 2014Dotby Justin Gordon
Rails Gem Upgrading Tips and Strategies

Best-practices for upgrading Ruby on Rails gems to newer versions while saving time and avoiding headaches.

13 Sep 2014Dotby Justin Gordon
Specific Issues Upgrading Gems to Rails 4.1, RSpec 3, and Twitter Bootstrap 3.2

This article describes some tougher issues I faced when upgrading to Rails 4.1 and RSpec 3.

12 Sep 2014Dotby Justin Gordon
Fast Tests: Comparing Zeus with Spring on Rails 4.1 and RSpec 3

A comparison of using Zeus vs Spring with Rails 4.1 along with the parallel-tests gem.

9 Sep 2014Dotby Justin Gordon
Pry, Ruby, and Fun with the Hash Constructor

Example showing how pry can help one better understand the useful Ruby Hash[] constructor.

17 Aug 2014Dotby Justin Gordon
2014 Golden Gate Ruby Conference: Top 10 Reasons to Attend

My top reasons to attend the 2014 Golden Gate Ruby Conference (GoGaRuCo).

13 Aug 2014Dotby Justin Gordon
RailsConf 2014

RailsConf Notes

23 Apr 2014Dotby Justin Gordon
Rocking with tmux, tmuxinator, Guard, Zeus, and iTerm2 for Rails Development

tmux, tmuxinator, and iTerm2 tips for productivity with Rails Development

11 Mar 2014Dotby Justin Gordon
Capybara PhantomJs Poltergeist Rspec Tips

9 Mar 2014Dotby Justin Gordon
Simple Form and Disabling Buttons on Submit by Default

Fixing RecordNotUnique errors by turning on disable_with by default for all submit buttons using simple_form.

23 Feb 2014Dotby Justin Gordon
GoGaRuCo 2013: Community > Code

A Newbie's 2013 GoGaRuCo Experience

22 Sep 2013Dotby Justin Gordon
Migrating from Capybara-Webkit to Poltergeist-PhantomJs

Tips for efficiently migrating a test rspec test suite from capybara-webkit to poltergeist-phantomjs

6 Aug 2013Dotby Justin Gordon
Testing Error Handling

How do ensure that your application properly handles errors, especially when relying on third parties, such as payment processors? Is it easy to verify that the right things happen when the wrong things happen?

11 May 2013Dotby Justin Gordon
Strategies for Rails Logging and Error Handling

Clean logging and error handling is a critical aspect of a RoR app. What’s a good strategy? Why does this matter?

8 May 2013Dotby Justin Gordon
Are you looking for a software development partner who can
develop modern, high-performance web apps and sites?
See what we've doneArrow right