Saturday, February 18, 2017

This Week in Rails: Freeze strings related to caching, query optimization for Postgres and more!

Posted by prathamesh

Hey everyone 👋

Prathamesh here with the latest from the world of Rails.

⚡️This week’s Rails contributors ⚡️

This week was full of improvements and bug fixes. We have 24 awesome people contributing to Rails with 3 first-timers!

Improved

This change freezes the common strings used for fragment caching reducing the string allocations every time a read/write operation is performed on the fragment cache. The patch showed proper object allocation benchmarks showing a noticeable improvement, so it was accepted.

Optimize query for finding primary keys of a Postgres table

This change simplifies and optimizes the query used to determine the primary keys of a PostgreSQL table improving the overall setup time.

Fixes

Fix generator command for namespaced Rails engines

This change fixes the default generators to create proper namespaced resources for a namespaced Rails engine. For e.g. if we have a namespaced engine bukkits-admin , then

bin/rails g scaffold User name:string age:integer

will now correctly create

admin/app/controllers/bukkits/admin/users_controller.rb.

remove_index method can remove expression indexes now

Now, remove_index method can also be used to remove expression indexes apart from simple column indexes.

That’s it from This Week in Rails. There were many other great contributions, too numerous to list here, but feel free to check them out

See ya next week 👣