Goodbits logo black in white circle

This week in Rails

Subscribe

This week in Rails


Weekly inside scoop of interesting commits, pull requests and more from Rails, delivered to your inbox every Friday. Read more about our story!

Confirm that you're not a robot:
Browse Previous Issues
May 23 Jun 6

Jun 2 2014

Issue #12


Logo for This week in Rails

Issue #12

Welcome to This week in Rails, your weekly inside scoop of interesting commits, pull requests and more from Rails.

Featured

Rails 4.1.2.rc1 and 4.0.6.rc1 released

These maintenance releases contain bug fixes for their respective release series. If you have some time this week, help the Rails team by giving them a spin in your app and report any issues you found!

New Stuff

Deprecated all `*_filter` callbacks in favor of `*_action` callbacks

You probably saw this one coming – the classic before_filter-family hooks in the controller will be deprecated and eventually removed from Rails in favour of the before_action-family hooks.

(Note: there is an ongoing discussion around when this deprecation should happen, due to concerns from gem authors who need to support multiple versions of Rails. Therefore, there is a good chance that this commit will be eventually reverted and deferred to a later release. Nevertheless, you should start using the new names in your application if possible.)

How to benchmark your pull requests

If you submit a pull request that modifies a performance "hot path", it would be helpful for the reviewer if you could attach a benchmark to ensure that your patch did not introduce any performance regression. (Similarly, if your PR is to address a performance issue, a benchmark would help to know that it actually works.) This new section in the contributors' guide shows you how to do just that.

New default script: `bin/setup`

New applications generated with Rails 4.2 will come with a bin/setup file. Similar to how seeds.rb was added for managing seed data, this script is the conventional place for bootstrapping your application.

Documentation for Rails' versioning scheme

This new section in the guides documented the meaning of each segment in Rails' version string.

Fixed

How to cherry-pick from Active Support

If you need to cherry-pick any features from Active Support in your project, you should always require active_support before requiring the individual features/files you need.

Skip individual tests upon `Dalli::RingError`

Memcached failures is one of the most common false-failures on Rails' travis CI setup. If you have similar problems in your CI setup, you might want to check out this neat little trick by @matthewd to reduce these random CI failures.

Escape user input before appending them on the page

Since Rails seamlessly handle most of the input-sanitization for us, it is quite easy to forget about these problems when switching into JavaScript-land for your frontend code. (As pointed out in the commit message, this particular bug is unlikely to cause problems as the routing error page is disabled by default on production.)

Not Fixed

Removed deprecated `Numeric#ago` and friends

If you have code that relies on implicit conversion from Numeric to seconds (e.g. 5.ago), you should replace them with an explicit call to #seconds (e.g. 5.seconds.ago) as the former will cease to work in Rails 4.2+.

Wrapping up

And that's it for this issue of This week in Rails. I say this every week, but this week there's an usually huge list of interesting things happening on Rails than I can cover here, so I encourage you to check them out!

If you have any feedback for me, please feel free to email me or let me know on twitter!

Thank you for reading! <3 <3 <3

P.S. If you liked what you read, please share this newsletter with your Rails friends!










May 23 Archive Jun 6

© 2014-2019 This week in Rails

Published via Goodbits