api.rubyonrails.org

Instantiating ActiveRecord objects comes expensive. To speed up things, you can choose a more direct way to talk to your...

api.rubyonrails.org

When working with custom transactions and use ActiveRecord::Rollback you may encounter unexpected behaviour if you try to roll back...

We often use VCR to stub external APIs. Unfortunately VCR can have problems matching requests to recorded cassettes, and these...

#reverse_order does not work with complex sorting constraints and may even silently create malformed SQL for rails < 5.

davidverhasselt.com

Rails 5 / 6 / 7 Method Uses Default Accessor Saves to Database Runs Validations Runs Callbacks Updates updated_at/updated_on Respects Readonly...

You might get the above error message when cloning certain git repositories (for example the rails repository). It indicates that...

Detect if a gem has been activated A gem is activated if it is either in the current bundle (Gemfile.lock...

github.com

We have released a new library Gemika to help test a gem against multiple versions of Ruby, gem dependencies and...

blog.bigbinary.com

Rails 5 migration classes look like this now: class CreateUsers < ActiveRecord::Migration[5.0] Mind the [5.0] at the end.

api.rubyonrails.org

ActiveSupport::Notifications provides an instrumentation API for Ruby. It is used throughout rails to publish instrumentation events that include information...

You know those helper methods that just render some HTML but look weird because of content_tags all over the...

github.com

We have a new gem Minidusen which extracts Dusen's query parsing and LIKE query functionality. Minidusen can no longer...

github.com

If you were using Dusen for its query parsing and LIKE queries, we recommend to migrate to Minidusen, which extracts...

Capistrano is by default configured to exclude the gems of the groups development and test when deploying to the stages...

You want Spring for super-fast binstubs like bin/rails or bin/rspec which avoid Rails boot time. You want parallel_tests...

speakerdeck.com

Presentation about optimizing Ruby on Rails apps. From Nico Hagenburger (homify's lead frontend developer).

To simulate Rails' to_sentence in your JavaScript application, you can use these few lines of CoffeeScript code: joinSentence = (array...

To check the currently running PG version from your Rails application (e.g. Rails console on your production server), simply do...

We're using Middleman for some static sites like our blog. Despite being very similar to Rails, Middleman does not...

When your controller action raises an unhandled exception, Rails will look at the exception's class and choose an appropriate...

PostgreSQL, unlike MySQL, treats strings as case sensitive in all circumstances. This includes comparison with = and LIKE collision detection in...

When building a web application, one is tempted to claim it "done" too early. Make sure you check this list...

tenderlovemaking.com

You can define methods using def or define_method. In the real world, there is no performance difference.

This is quite an edge case, and appears like a bug in Rails (4.2.6) to me. Update: This is now...