This week in Rails: 4000 contributors, Rails bot abides and more!

Back away, bystander.

There’s a flame war going on, and we’d best contain it soon — the people need their Rails news!

Kasper pats flames and waters ferns in hopes we douse the mighty fires.

I’ll go brush up on campfire safety rules. Here, you read these.

Over 4000 people contributed to Rails

A little while ago we crossed 4000 contributors – that’s crazy! Remember the old days when only one person contributed to Rails? Well, I wasn’t him so I don’t. Wups!

36 people made their mark this week. If you’re new, peruse the list and join us. If you do you’ll find a new friend waiting for you.

Everybody meet Rails bot

That friend is Rails bot. Fresh off the assembly line to bring those new to Rails a welcome message and tips. You’ll even get a reviewer assigned to help move things along. Come say hi with a pull request.

Improved

Confirmation validation reduced sensitivity to case

If you’re validating an email confirmation and you don’t care about the case, it can be skipped with case_sensitive: false

Migrations explains which part is irreversible

In Rails 5 if you’re using a migration method that isn’t reversible (meaning it can’t rollback) you will be warned about the offending method and how to roll your way out of that mess.

Fixed

Passing a relation to cache uses Relation#cache_key

Banking on the cache_key added to relations a while ago, any cache calls in your views correctly use that instead of turning the relation into an array.

bin/rails test -e requires an argument

In Ruby’s OptionParser, if you wrap a parameter in brackets it’s considered optional.

By breaking it out of the brackets, writing bin/rails test -e with an empty argument now raises a more appropriate error.

Array Inquirer finds both symbols and strings

Using any?(:idea) on ["innovative", "idea"].inquiry wouldn’t find anything because the symbol passed to any didn’t match any of the strings in the array.

Now everyone expects the string inquiry — and there’s room for “innovative” “ideas” once again.

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.

Rails 4.2.4 is out, params.require accepts arrays, Rack 2 is on its way and I'm no longer a teapot!

Hi, everybody! This is Tim and Claudio reporting here from sunny Los Angeles. It’s been a week of intense weather here, and even more intense activity in the Rails community. Let’s take a look at the highlights…

Releases

Rails 4.2.4 and 4.1.13 have been released!

The new versions are backward compatible, so if you are using any 4.2.x version, you can safely upgrade to 4.2.4. And if you are using 4.1.x, bump your Gemfile to 4.1.13.

This week’s Rails contributors

This week 47 awesome people helped to make Rails even better, including 3 for the first time. If you are interested in becoming a contributor, you can have a look at the issues list.

New Stuff

An AsyncAdapter for Active Job

Do you need to create asynchronous jobs without installing additional gems? Set config.active_job.queue_adapter = :async and post your jobs to a concurrent-ruby thread pool.

A new format for params.require

params.require can now take multiple values as an array, allowing for more succinct code such as params.require(:person).require([:first_name, :last_name])

Getting ready for Rack 2

In Rack 2, the env hash will be changed to be actual request and response objects. This commit paves the way for Rails to be compatible when Rack 2 is released.

Improved

Speed improvements for loadable_constants_for_path

Pull requests that improve the performance of Rails are always welcome, especially when they come with benchmarks showing a speed increase of 9x!

Fixed

Goodbye 418 (I’m a teapot)

RFC 7231 changed the list of HTTP status codes (dropping “418 I’m a Teapot” among others). Rails documentation has now been fixed to list the symbols that can be used to represent status codes.

Wrapping Up

One last thing that deserves a mention is that the new Code of Conduct has gone live on the main website. Hurrah!

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.

[ANN] Rails 4.2.4 and 4.1.13 have been released!

Hi everyone,

I am happy to announce that Rails 4.2.4 and 4.1.13 have been released.

No regressions were found so these releases include the same changes that the release candidates.

CHANGES since 4.1.12

To view the changes for each gem, please read the changelogs on GitHub:

Full listing

To see the full list of changes, check out all the commits on GitHub.

CHANGES since 4.2.3

To view the changes for each gem, please read the changelogs on GitHub:

Full listing

To see the full list of changes, check out all the commits on GitHub.

SHA-1

If you’d like to verify that your gem is the same as the one I’ve uploaded, please use these SHA-1 hashes.

Here are the checksums for 4.1.13:

$ shasum *4.1.13*
7c637fed154a152451adb8ef1ebae136e0502ebd  actionmailer-4.1.13.gem
61303b7ee877aa06f16ce0ba6a7cce21ca031f42  actionpack-4.1.13.gem
39c5a4a290a5969402bf5c4ac61b99e5dcb40c3c  actionview-4.1.13.gem
6d88159aa15ea48f9118ece97ec549807a504f55  activemodel-4.1.13.gem
1107470b19cc0d6608d431678c78d3871c8df229  activerecord-4.1.13.gem
f79bdfa0105c1a833069d989291ec9d23bc84d92  activesupport-4.1.13.gem
6391b4a323e0b30118ffdbad6bb5f68459920d7b  rails-4.1.13.gem
fc64a4f89a3fa8f9ab2a9edd37d7338a79cb9859  railties-4.1.13.gem

Here are the checksums for 4.2.4:

$ shasum *4.2.4*
a866394bb4682afaa6d54458b1f3be0dca5e862e  actionmailer-4.2.4.gem
b625e58fb8fa11185ff81630f3bef5c517e294e4  actionpack-4.2.4.gem
334ddc60724e4e1ff99e2170d2e435805d0ade0b  actionview-4.2.4.gem
7bd46253f17bcff5c8ae3ba0f0938c38b0ca1e2f  activejob-4.2.4.gem
d361d1e0eac7851103ac2de4c9359a556c724ab9  activemodel-4.2.4.gem
d9faecb759827fc7944558463388efbbd9f20005  activerecord-4.2.4.gem
ab4283126725e3aa9c248e2e2119548ad205732d  activesupport-4.2.4.gem
67d7a12105f5389dd7b511eff5f56c6c048175d8  rails-4.2.4.gem
8e9eab180dbd97eaf7626601c55e61ea1ae68284  railties-4.2.4.gem

I’d like to thank you all, every contributor who helped with this release.

🚂 This week in Rails 🚂: Learn How These 37 Rails Contributors Improved The Entire Framework In Just One Week

Good News Everyone, This Week In Rails has been acquired by BuzzFeed!

Just kidding. This is Godfrey here. It’s been a while since I get to write one of these myself and I’m very happy to be back. Without further ado, let’s dive right into it!

❤️ Code of Conduct

The Rails team is committed to fostering a welcoming community for everyone. With the help of our community, we have added an official Code of Conduct for the project this week.

😱 37 Programmers Contributed To Rails And You Won’t Believe What Happened Next

Well, their pull requests were merged and they are immortalized on the Rails Contributors website. And oh, everyone please send a warm welcome to the 10 first-time contributors this week!

📦 Releases 📦

📢 Sprockets Has Hit Version 3.3.3, What Does That Really Mean For The Rest Of Us?

According to @schneems who is responsible for the release, this is supposed to fix an issue for those of you “who share a cache in different directories between deploys”, which includes Heroku deployments.

💎 New Stuff 💎

💾 MySQL Finally Gets A Native JSON Data Type – But Is It Too Late To Save California?

MySQL has recently added a native JSON data type (perhaps inspired by its more popular cousin, PostgreSQL). Thanks to this patch, you will be ready to take advantage of that feature in Rails 5.

👌 Fixed 👌

🎂 The One Weird Trick That Lets You Write To Files Atomically

Concurrency is hard, but Rails might have finally cracked the nut. You might not know that Active Support offers a way to write to a file atomically with File.atomic_write.

Even if you have heard about it, you probably didn’t realize there is a subtle race condition in its implementation. Anyway, with this patch landing on master, those bugs will soon be behind us and we can all just sit back and enjoy the convenience it provides.

👍 Improved 👍

🚨 Nobody Likes To Do Repeated Work – Here Is A Cache They Won’t Tell You About

It turns out that things do not run twice as fast when you double-cache them. Who would have thought? (I wish we all wrote great commit messages like this by the way!)

✂️ Testing Is Important, But Has Rails Gone Too Far?

Along those same lines, it turns out that testing the same thing twice doesn’t provide much value either.

🙈 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.

This week in Rails: Rails 4.2.4 RC1, 4.1.13 RC1 and more!

Hello Everyone! This is Roque bringing the latest from Rails with some help from Kasper.

This Week’s Rails Contributors

We had 36 awesome contributors to the Rails codebase this week. Check out the active issues over on GitHub if you’d like to see your name here.

Rails 4.2.4 RC1 and 4.1.13 RC1 have been released!

There’s new release candidates, please try them and report any regressions you find, so that the Rails team can fix them before the final release.

Thank you to all contributors for these releases!

New Stuff

Active Record relations come in batches

This week Active Record got a new method that works like find_in_batches but yields relations instead of arrays. It also added a cool delegation API that lets you do something like:

People.in_batches.delete_all('age > 21')

Oh, in case you were wondering – this is pretty much how Skynet works.

Improved

i18n reloading picks up new and deleted files

This patch allows new locale YAML files to be loaded without having to restart the Rails server. It also reloads the available locales when files are deleted.

Active Job assertions returns matched job

The matched job returned by these methods can be used for advanced assertions like:

job = assert_enqueued_with(job: SomeJob) do
  some_business_logic
end
assert_equal 5, job.arguments.second

Spun Off

XML serialization have been moved to a gem

As usage for XML serialization declined, it’s become less of a core concern of Rails. In Rails 5, this feature will be moved to the activemodel-serializers-xml gem.

If you’re still using the XML Serialization feature in your app, you will need to add this to your Gemfile when you upgrade.

That’s a wrap

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.

[ANN] Rails 4.2.4.rc1 and 4.1.13.rc1 have been released!

Hi everyone,

I am happy to announce that Rails 4.2.4.rc1 and 4.1.13.rc1 have been released.

If no regressions are found expect the final release this Wednesday, on August 19, 2015. If you find one, please open an issue on GitHub and mention me (@rafaelfranca) on it, so that we can fix it before the final release.

CHANGES since 4.1.12

To view the changes for each gem, please read the changelogs on GitHub:

Full listing

To see the full list of changes, check out all the commits on GitHub.

CHANGES since 4.2.3

To view the changes for each gem, please read the changelogs on GitHub:

Full listing

To see the full list of changes, check out all the commits on GitHub.

SHA-1

If you’d like to verify that your gem is the same as the one I’ve uploaded, please use these SHA-1 hashes.

Here are the checksums for 4.1.13.rc1:

$ shasum *4.1.13.rc1*
284f1eb3a000d54f07435e0b19e88f1ba80f738b  actionmailer-4.1.13.rc1.gem
352ad673a18efe226ed3e1b1eb7e61818ccae1a2  actionpack-4.1.13.rc1.gem
f7e147aa4377149a7516bf23fa5892979a7ff77f  actionview-4.1.13.rc1.gem
70da96abb737ef31eba8e1b57fa2cb122110bb59  activemodel-4.1.13.rc1.gem
c571e1092a3982517d353ff85fab2c5e9b3c28cc  activerecord-4.1.13.rc1.gem
19e9f8f248261d6b605c62eca071e29e9c7e5a90  activesupport-4.1.13.rc1.gem
7c418986f10ff82fbb1be1b3a6c9defb80aac5eb  rails-4.1.13.rc1.gem
e5ca51e2cb32fa57bd7ba18f8fe52cd3c0e2bbb9  railties-4.1.13.rc1.gem

Here are the checksums for 4.2.4.rc1:

$ shasum *4.2.4.rc1*
7f343fd97d1e41920feac65020fa487c4d0be67e  actionmailer-4.2.4.rc1.gem
f815f40569f0e6b93f10c61d696d9ab06aba6531  actionpack-4.2.4.rc1.gem
bca83efa6384b88b5429f1dad1dd1a05e7c8e491  actionview-4.2.4.rc1.gem
7d8694143e23712da67606ea78919ed71605dd19  activejob-4.2.4.rc1.gem
674d0fd053f8365a1be9fe787f6fe10c5b9b3993  activemodel-4.2.4.rc1.gem
ec34623a19a136dcb62308ad3dfeba3209a5beac  activerecord-4.2.4.rc1.gem
8673028f02630357ea1f086323468b4a733b00aa  activesupport-4.2.4.rc1.gem
970ee741e3e2ffcaae6cbb33895ee2dc407bb5a3  rails-4.2.4.rc1.gem
69f16c95fac8739bc62e5f2cbe352bfa05746223  railties-4.2.4.rc1.gem

I’d like to thank you all, every contributor who helped with this release.

This week in Rails: caching madness, Active Job improvements, and even more performance!

What’s up, gang? Todd here with another edition of This Week in Rails. It was a bit of a quiet week in Railsland, but I think we’ve got some quality contributions here. Read on for the deets!

This Week’s Rails Contributors

We had 39 awesome contributors to the Rails codebase this week. Check out the active issues over on GitHub if you’d like to see your name here.

New Stuff

Add #cache_key to ActiveRecord::Relation

This addition bakes a strategy for generating collection cache keys directly into ActiveRecord::Relation. Using #cache_key, it’s now possible to automagically generate a unique key on relations for use with Rails’ fragment cache.

Development Server Caching Toggle

Per a request from DHH, this change adds the ability to enable or disable caching in a development environment. There are two ways to toggle it - on server start with --[no-]dev-caching or with the dev:cache rake task.

Improved

Active Job and Locales

Active Jobs queued with #perform_later previously wouldn’t honor the context’s locale. This patch rectifies that by storing it on the job directly.

Even More Performance Improvements!

By using #start_with? instead of matching on a regex, 765.5 ms have been shaved off of the total aggregate request time per 1000 requests. In conjunction with other performance work recently completed, this knocks a whopping 1.5 seconds off over the course of 1000 requests.

That’s a wrap

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.

This week in Rails: wildcard template dependencies and more performance!

Happy Friday Everyone!

This is Greg with the latest news about Rails. We had a quiet week so this issue will be a short one.

This week’s Rails contributors

This week 23 awesome people helped to make Rails even better. If you are interested in becoming a contributor, you can have a look at the issues list.

New Stuff

Wildcard template dependencies

You can define your template dependencies with a wildcard and do more with less code!

Plugin generator for API applications

This pull requests adds an --api option in order to generate plugins that can be added inside API applications.

Improved

Performance improvements

By reducing the number of object allocations, this giant patch helps reduce memory usage and also brings you some significant speed improvement (as a benchmark, codetriage.com ran about 10% faster).

Fixed

Uniqueness validator fix

This commit fixes an issue when using the uniqueness validator against a custom primary key.

That’s a wrap

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.

This week in Rails: goodbye Rack::Lock, concurrent-ruby, better AC::Parameters and more

####

Hello Everyone!

This is Vipul from Pune, waiting to enjoy some sweet Sheer khurma, and delicious Biryani with my friends, since Eid is just around the corner.

Hmm, Yum.

This week’s Rails contributors

This week 28 people helped make Rails even more awesome than before. Big thank you to all these amazing people! If you’d like to chip in, there’s always something you could help work on!

New Stuff

Remove Rack::Lock

This is one of the many concurrency-related work that went into Rails this week.

Instead of forcing Rack::Lock when eager_load and cache_classes are off, this change just prevents actual race conditions.

It is achieved by means of a (reentrant) shared-exclusive lock. This allows multiple concurrent requests but ensures any code-loading activity gets performed in isolation.

Improved

Replace ActiveSupport::Concurrency::Latch with Concurrent::CountDownLatch from concurrent-ruby

ActiveSupport::Concurrency::Latch was replaced with Concurrent::CountDownLatch from the concurrent-ruby gem.

This replaces concurrency related code cluttered in AS and offloads it to concurrent-ruby gem, which has many concurrency utilities with runtime-specific optimizations.

Deprecate force association reload by passing true

This is to simplify the association API, as we can call reload on the association proxy or the parent object to get the same result.

So now to reload one would call @user.posts.reload instead of @user.posts(true) for collections and @user.reload.profile instead of @user.profile(true) for singular associations.

See also this mailing list thread for more background information.

Fixed

Test runner now works correctly inside Engines

The bin/rails test has now been extended to work properly instead engines, where previously we needed to do rake test.

ActionController::Parameters no longer inherits from HashWithIndifferentAccess

Inheriting from HashWithIndifferentAccess allowed users to call any enumerable methods on Parameters object, resulting in a risk of losing the permitted? status or even getting back a pure Hash object instead of a Parameters object with proper sanitization.

This change fixes this behavior and makes sure all the methods defined on Parameters will return a Parameters object with the correct permitted? flag.

That’s a wrap

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.

This week in Rails: Action Cable, collection caching and more

####

Hi This is Prathamesh bringing together all the latest happenings from the Rails world.

Action Cable alpha is out!

Action Cable is out in wild as promised by DHH in his Railsconf keynote. There is flurry of activity happening with it right now. It’s still in alpha mode and will get production ready with Rails 5.

This week’s Rails contributors

Meet the 21 lovely people who contributed to Rails this week, the community can’t thank you all enough!

New Stuff

Explicit collection caching directive

Now we can explicitly specify collection caching using a special directive # Template Collection. The partials which do not start with <% cache do %> calls will get benefitted by this feature.

Improved

Filter params based on parent keys

Do you have nested params with same child key and different parent keys? Do you want to filter the child keys for only some of the parent keys? Now you can! Params can be filtered based on parent key using a simple config.

Fixed

Fix inconsistent behavior of HWIA with default_proc

Thanks to this fix, behavior of HWIA is now in sync with Ruby’s built-in Hash when a default_proc is set on the instance and it is duped.

That’s a wrap

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.