Saturday, September 12, 2015

This week in Rails: Performance, MySQL prepared statements and more!

Posted by _cha1tanya

This is Prathamesh after a long long time bringing you latest and greatest news from Rails world!

This weeks Rails contributors

37 people contributed to Rails this week, including 7 first-time contributors. If you are interested in becoming a contributor, you can have a look at the issues list.

New Stuff

Drop indexes concurrently in PostgreSQL

Now you can drop PostgreSQL indices concurrently in Rails 5, just like how you can already add indices concurrently today.

Approachable SSL handling

Remember good ‘ol config.force_ssl? You can now use it with greater control. With improvements in SSL redirect and better handling of Strict Transport Security, you will surely love this improved version of config.force_ssl.

Mult-context validations

Ever faced the need of running validations of create and update contexts both at the same time? Now you can do that by passing multiple contexts to the #valid? and #invalid? methods.

Improved

Active Record performance improvements

This week lot of work was done for improving Active Record internals by reducing object allocations, avoid creating relations when not required and so on. Kudos to @tgxworld!

Prepared statements with MySQL

Rails now supports latest version of mysql2 gem. Is this a big deal? Yes!! You can now use prepared statements using this version. Now that’s awesome!

Improve sql logging coloration

If you are using custom SQL queries with Ruby herredoc, you will be able to identify them instantly in your logs. Why? Because they will have better colors thanks to this patch.

Not just that, overall coloration of all SQL queries is improved here as well!

The cookie-handling code in Rails is one of the more complicated code in the framework, largely due to the need to support and migrate legacy cookies produced by older versions of Rails.

Kasper refactored some of those code to make it less hostile to future improvements, nice!

Fixed

Generator errors messages will be in plain English

If you have seen some weird characters showing up in error messages of rails g commands due to localization of some messages, it is now fixed!

Wrapping Up

That’s all for This week in Rails. As always, there are many more changes than we have room to cover here, but feel free to check them out yourself!

Have you been thinking about writing for us, but you’re scared of putting yourself out there? Don’t worry, you can help our editors improve their writing with thoughtful critique and general grammar policing.

You up for that? Tell Godfrey today.