[ANN] Rails 4.2.1.rc2 and 4.1.10.rc2 have been released!

Hi everyone,

I am happy to announce that Rails 4.2.1.rc2 and 4.1.10.rc2 have been released.

There were found some regressions in the last release candidates so, following release process we are releasing new release candidates.

If no regressions are found expect the final release this Monday, on March 2, 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.9

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

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.10.rc2:

$ shasum *4.1.10.rc2*
2ac66bc18099e97e91433dd2a16610840adbe229  actionmailer-4.1.10.rc2.gem
7af1a70d5436936df7602ce25b8607dd657d26fd  actionpack-4.1.10.rc2.gem
25f87be1c36551583c5bdc3034731ab9d327e650  actionview-4.1.10.rc2.gem
61eddccaa119592a8fa3424e33af26f3c52afd87  activemodel-4.1.10.rc2.gem
30bd5d356e704f9122f51d0503a3d57bd4b7c456  activerecord-4.1.10.rc2.gem
1da6fd1c9f6a5bebf743ddbc13d25c54293baf5a  activesupport-4.1.10.rc2.gem
7c42be6e6a7f059dcad390f0d690aff842138870  rails-4.1.10.rc2.gem
3f036bc1450f4e784ee0ce8118f057f68e56422d  railties-4.1.10.rc2.gem

Here are the checksums for 4.2.1.rc2:

$ shasum *4.2.1.rc2*
af8d52587a348ea70e9b6a751207a9a6aa4044f3  actionmailer-4.2.1.rc2.gem
ab218bb9396357b48027e1512544cfb3188ec3bd  actionpack-4.2.1.rc2.gem
5315fd389885775fc03863146704aab37333e0c8  actionview-4.2.1.rc2.gem
15c11c2aff82876241a3a9ff90b00dfb6d834fa2  activejob-4.2.1.rc2.gem
f700c318378a8e3292b23c9495e68bc49f9a1ef1  activemodel-4.2.1.rc2.gem
dc91f9e52b8fd9ab0fac294f13ab7f9425cb0a67  activerecord-4.2.1.rc2.gem
ab95e792e93392605985469b3ec0546d3917c63c  activesupport-4.2.1.rc2.gem
af242d941255666ce08a51813898fe8c29bb613d  rails-4.2.1.rc2.gem
c0e72712484fdc821d6a0f08504318e075feba83  railties-4.2.1.rc2.gem

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

This week in Rails: http_cache_forever, AR::Base.suppress and more!

My Valentine’s Day letter to Ruby on Rails:

“Dear Rails, remember the first time we met?
You were just 1.2, and I was in an unhealthy relationship with Perl and PHP.

I saw you in the library and I immediately fell in love.
For seven years, you made my code more readable and my skills stronger.

You are the most beautiful framework and always will be.
I cannot wait to see you turn 5.0.” – Claudio

Featured

This Week's Contributors

Apparently I'm not the only one in love with Ruby on Rails. 36 programmers contributed to Rails this week, 10 of them for the first time. Keep loving!

New Stuff

Add http_cache_forever to ActionController

The new method is perfect to cache results that are meant to never expire, such as static pages.

Add ActiveRecord::Type.register

You can now reference with a symbol any database type that is specific to your adapter, such as:
ActiveRecord::Type.register(:money, MyMoneyType)

Add ActiveRecord::Base.suppress

Wrapping a block with suppress will prevent any save operation from hitting the database. Check the PR for a real-world example.

Improved

Add :time option to ActiveRecord::Base.touch

You can now touch an ActiveRecord instance with a different time than the current time.

Removed

Removed RecordTagHelper

The helpers div_for and content_tag_for will be gone in Rails 5. Grab the record_tag_helper gem if you still need them!

Removed ActiveModel::Errors getters/setters

If you ever used person.errors.get(:name) or person.errors[:name] to read an error message, you should now switch to person.errors.messages[:name]. add_on_empty and add_on_blank are gone too.

Update: you should be using person.errors[:name] after all! Use person.errors.add(:name, ...) to append.

Wrapping up

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

P.S. If you enjoyed this newsletter, why not share it with your friends? :) If you wish to be part of this project please don't hesitate to contact Godfrey – there're a lot of ways you could help make this newsletter more awesome!

[ANN] Rails 4.2.1.rc1 and 4.1.10.rc1 have been released!

Hi everyone,

I am happy to announce that Rails 4.2.1.rc1 and 4.1.10.rc1 have been released.

If no regressions are found expect the final release this Wednesday, on February 25, 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.9

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

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.10.rc1:

$ shasum *4.1.10.rc1*
173663408f82f4f6b718d0493ccd7372b1ebb04b  actionmailer-4.1.10.rc1.gem
e2f2239ba08498b0222c73d749ce1fc0b80227ce  actionpack-4.1.10.rc1.gem
3ea60b85b2c6d9c6dd517f19cca6d4184f168c3e  actionview-4.1.10.rc1.gem
fad32c6fa623c848c59c7ec4ea6f95bbe55c800e  activemodel-4.1.10.rc1.gem
5fa2bbfc017cd5000d5a05923b0ed00eaf0763d2  activerecord-4.1.10.rc1.gem
593986a562d2967690def2acfb4f3807b749c8d5  activesupport-4.1.10.rc1.gem
9b3243b73e8094bdef92a9a3fe8e13c59660fcb8  rails-4.1.10.rc1.gem
629269e65fb4b2eaacf3341060b06a6857479ec8  railties-4.1.10.rc1.gem

Here are the checksums for 4.2.1.rc1:

$ shasum *4.2.1.rc1*
7540e2101c574c1b28428d25b26e2840bd811b07  actionmailer-4.2.1.rc1.gem
2256120417e0a2c554fa622f59bfce672c565df2  actionpack-4.2.1.rc1.gem
6add23517bf1c2cdc29b04e5634305c0b5bcc496  actionview-4.2.1.rc1.gem
894a9419a70e6061e07ab2c23f75f0c5fd886b10  activejob-4.2.1.rc1.gem
c268d0711889e2df9991a80f1e01180573b79f9f  activemodel-4.2.1.rc1.gem
39ca67053e52260954876fbf385e260b56c870b9  activerecord-4.2.1.rc1.gem
a937629fed3f6ddeb9f939273dd5e7955a7f25a1  activesupport-4.2.1.rc1.gem
773cce2bacede08390bf9488665d03af33995271  rails-4.2.1.rc1.gem
703b959222cd0466a244cca5bd322de9fb7b76a6  railties-4.2.1.rc1.gem

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

This week in Rails: Speedy Integration Tests, Enum Queries and more!

Dearest darling, reindeer-eyed reader

Hither summoned is Kasper, Duke of Friendly Ghosts, to bring forth thy worthy commits and Pull Requests of Rails as subscribed.

Thusly commences our journey on this Friday the 13th - Ok, I'm sick of writing like that.

Featured

This Week's Contributors

A round of applause goes to this weeks contributors from all of us at this virtual news desk. We editors did a full on spit take when realizing a whopping 28 people contributed. Nothing seals that memory quite like the scalding coffee on our thighs.

Integration Tests Only 12% Slower than Controller Tests

You may have thought Speed was just a movie. But we're feeling it this week as our world got rocked with a refactoring bringing integrations' speed closer to functionals. Stay at the edge of your seats for the sequel.

Improved

Make enums queryable by label

After an amazing refactoring job on Active Record internals that took many months, this change was easy. Enums can now be queried by their labels. Post.where(status: Post.statuses[:draft]) is out in favor of Post.where(status: :draft).

fresh_when and stale? accepts a collection

They say that stale? is everyone's best friend. It will be by you until you get to fresh_when. Even if you need help when a collection seems impassable. Look around, you dingus, your best friends are adaptable.

There's usage examples on the Pull Request.

find_in_batches got an end_at option

Sometimes you gotta know when the fun oughta stop. Sadly find_in_batches and find_each would keep going like the party animals they are. Or were, as both matured this week with a new end_at option. But they're still keeping it plenty rad in their parents basement if anybody asks.

One More Thing™

Kasper Timm Hansen is an issues team member

Kasper first impressed us when he shipped his 2013 Rails GSoC project in 2014. In his spare time he writes a newsletter called This Week in Rails. In fact he wrote this very issue. Aw shucks, I thought there was something familiar about me and I!

Wrapping up

This was a weird one, right? Hopefully of the glorious kind.

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

P.S. If you enjoyed this newsletter, why not share it with your friends? :) If you wish to be part of this project please don't hesitate to contact Godfrey – there're a lot of ways you could help make this newsletter more awesome!

This week in Rails: locate_many, emoji partials and more!

Hey there!

Newsletter team is back to your inbox delivering all latest good commits and pull requests from Rails. Hopefully you have your favorite drink right there with you to make this quick reading ever better.

Featured

This week's Rails contributors

Over 25 people contributed to Rails this week alone. Perhaps by our next newsletter your name could be on that list too!

Improved

Efficient lookup for many models in Global ID

Latest version of Global ID 0.3.2 brings better look up for models. You can pass an array of ids to locate_many to fetch records only once per model. Check out the juicy comments of Core Team members figuring out their own API.

Partial names don't have to be valid Ruby identifiers

Rails master can render partial names like _the-friday-party.html.erb just fine now as well. If you are feeling extra adventurous, you might even try naming your partials with emojis!

perform_enqueued_jobs can filter jobs by type

By passing a only option you are able to test only those particular jobs while any other inside the block won't be performed. Checkout the changelog entry introduced for a crystal clear example usage.

Fixed

Child record validation respects validate: false on parents

Took a few years but this is fixed! Persisting child records will respect the current validation state of the parent record. Also good to see how the team is worrying about performance penalties for fixes in ActiveRecord core logic.

Removed

Dropping xhr helper to simplify AC::TestCase

You will need to update your test suites in case they use either xhr or xml_http_request test helpers. Instead switch to the regular get and pass the keyword argument xhr: true

Farewell Rails built in documentation tasks

Now comes a goodbye to a few friends most of us never knew we had: the documentation rake tasks. The three siblings doc:app, doc:rails and little doc:guides joins local documentation in a better place - online. Our thoughts are with the remaining rake tasks. Rest In Protocols.

One More Thing™

Eileen M. Uchitelle is a Rails Committer

Eileen has been doing awesome work on Active Record related to performance refactoring and bug fixes besides mentoring some students in the Facebook Open Academy program.

Wrapping up

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

P.S. If you enjoyed this newsletter, why not share it with your friends? :) If you wish to be part of this project please don't hesitate to contact Godfrey – there're a lot of ways you could help make this newsletter more awesome!

This week in Rails: Relation#or, file fixtures, kwargs and more!

It is that time of the week again!

This is Greg, bringing you this week's interesting commits and pull requests from Rails.

Featured

This week's Rails contributors

Let's start with a big thank you for all the people who helped this week to make Rails better!

New Stuff

Added #or to ActiveRecord::Relation

A long waited feature is added to Active Record and from now on you can combine two Active Record relations with the or operator.

ActiveSupport::Testing::FileFixtures

With this addition to ActiveSupport::Testing there is no need to write custom helpers for testing features requiring a sample file (i.e. file uploads).

Use kwargs in the test's HTTP methods

Support for keyword arguments is added to the HTTP methods of the controller tests. An example of the new syntax:

post :create, params: { y: x }, format: :json

Improved

Improved performance of integration tests

delegate turned out to be a bottleneck at the URL generation in the integration tests. With this patch the integration tests of the applications should have a speedup.

Allow hyphenated names for plugins

From now on you can generate a Rails plugin with a hyphenated name (i.e. namespaced engines).

Deprecated

*_via_redirect integration test methods are deprecated

The *_via_redirect methods are deprecated but do not fear, you can use follow_redirect! in your test suite for the same behaviour.

Fixed

Fixed HTTP basic authentication nil issue

When request.authorization returned nil, Rails raised a NoMethodError, but this is fixed now.

AR::Relation#group accepts SQL reserved keywords

This patch allows you to group by SQL reserved keywords with the group method of Active Record.

One More Thing™

Arthur Nogueira Neves is a Rails Committer

Please welcome our newest Rails Committer!

Wrapping up

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

P.S. If you enjoyed this newsletter, why not share it with your friends? :) If you wish to be part of this project please don't hesitate to contact Godfrey – there're a lot of ways you could help make this newsletter more awesome!

This week in Rails: model error details, drop table if exists and more!

It's Friday! Gotta get down on This Week in Rails!

This is Claudio, rushing to get you the weekly updates on interesting commits and pull requests from Rails.

Featured

This week's Rails contributors

25 contributors helped Rails become a better framework. Keep the patches coming, and Rails 5 will be ready before you know it.

New Stuff

ActiveModel::Errors#details

Given a user without an email, user.errors.details will return {email: [{error: :blank}]}. In some cases, this is more useful than the message {email: ["can't be blank"]} provided by user.errors.messages.
There's a good usage example in this blog post.

:if_exists option for drop_table

Writing drop_table(:users, if_exists: true) in a migration ensures that the migration will run without exceptions, whether or not the "users" table exists.

ActionController::Renderer

The ActionController::Base#render method can now output a template anywhere, even outside of a controller!

ActiveRecord::Base#accessed_fields

Calling @users = User.all to list all users works, but you can get better performance by indicating the exact fields you intend to access, for instance with @users = User.select(:name, :email).

The new @users.accessed_fields method will give you the list of fields accessed from the model, so you can easily optimize your queries using .select rather than .all.

Improved

Speed up ActionController::Renderer

Everyone loves a pull request that speeds up Rails, especially if the performance gain is documented and verifiable.
When in doubt, always use benchmark/ips to provide benchmark results for comparison.

Wrapping up

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

P.S. If you enjoyed this newsletter, why not share it with your friends? :) If you wish to be part of this project please don't hesitate to contact Godfrey – there're a lot of ways you could help make this newsletter more awesome!

This week in Rails: tokens migrations, method_source and more

Live from our servers, it's This Week in Rails!

As always we're your inside scoop of interesting commits, pull requests and more from Rails.

This is Kasper, and I'm ready to serve you this scoop. I tapped keys on the board in front of me to make words appear. It's quite the tapestry.

Let's get to it!

Featured

This week's Rails contributors

33 contributors made this week happen. Pull Requests were merged, new friendships were made... I think I even heard someone say they saw a cat online. That's a rare sight, and part of what made this week special. Thanks everyone!

Tokens in migrations and model generators

As a follow up to last week's has_secure_token, both the migration and model generators can create token attributes.
rails g migration add_auth_token_to_users auth_token:token. rails g model user auth_token:token.
The model generator automatically adds has_secure_token :auth_token to your new model file.

New Stuff

method_source added to the default Gemfile

On Rails 5 when you generate a new app, you'll find 'method_source' in your Gemfile. This gem extends the Method class with source and comment methods to aid your debugging. There's a good usage example in this comment.

Fixed

Allow '1' or true for acceptance validation

Previously validates_acceptance_of would only accept '1' as a valid attribute value. Now you can assign true to an attribute and the validation will pass.

Time columns will be aware of application time zone

In Rails 5.1 your time columns will adhere to the time zone of your Rails application. To make the upgrade path smoother, the config.active_record.time_zone_aware_types option has been added. See the deprecation warning here for help.

One More Thing™

Validation callbacks tested with contexts

A feature you might not have heard about is validation contexts, which allow you to specify a context a callback should only be run for. Like this: before_validation callback, on: :create. The link shows a few tests being for this on before/after_validation. Here is a more advanced example.

Wrapping up

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

P.S. If you enjoyed this newsletter, why not share it with your friends? :) If you wish to be part of this project please don't hesitate to contact Godfrey – there're a lot of ways you could help make this newsletter more awesome!

This week in Rails: a new beginning

Happy New Year, everyone!

It was only less than a year ago when I sent the first issue of This week in Rails to a total of 14 recipients, discussing some of the latest and greatest additions to the Rails codebase.

43 weeks later, this little hobby project has evolved into a true community effort –- we have assembled an amazing team of editors and other volunteers (join us!), keeping 2000 subscribers in the loop and highlighting some key contributions to our beloved web framework every week.

I am incredibly excited to announce that starting this week, we will be cross- posting the content from the newsletter to the Riding Rails blog. With this, we hope to reach even more members of our wonderful community, increase transparency, involve more of you in the decision-making processes and maybe even inspire some future contributors!

I would like to thank my team at Brewhouse and Goodbits for supporting the project and getting it off the ground, as well as all the volunteers who helped along the way. Of course, huge thank you to all of the Rails contributors who did all the hard work! <3 <3 <3

Without further ado, here is the first 2015 issue of This week in Rails!


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

Hi there this is Washington again!

Hope you all had the most gorgeous holidays ever doing things you love the most. The newsletter team is back to work and you should receive your Rails weekly news as usual. Here are some of the latest and greatest improvements, fixes and releases during the break.

Featured

Ruby 2.2.0 Released

YAY! December 25th saw another important Ruby release. See the blog post for all the goodies in this new version and keep in mind Rails 5 will target Ruby 2.2+ exclusively. As of this week, Rails' master branch will only work on Ruby 2.2 or above.

Rails 4.0.13 and 4.1.9 have been released!

4.0.13 is last planned release for the 4.0 release series, so you should migrate off it as soon as possible. From here on, the 4.1 (you can thank Rafael) and 4.2 release series will continue to receive regular bug fixes. Consult the maintenance policy for details.

This week's Rails Contributors

Apparently holidays is no excuse for going to the beach all day long and having drinks away from computers. Rails community kept working hard during the break to keep improving the framework we appreciate so much. Thank you all!

New Stuff

Halting callback chains by throwing :abort

As of Rails 5 callback chains won't be halted by returning false. Instead you should explicitly throw :abort. This will help keep things consistent among all frameworks included in Rails and avoid accidental halting caused by unexpected false return values.

New date helper

Working with days and weeks just got a bit easier. Keep in mind these new helpers on_weekend?, next_weekday, prev_weekday, next_day, prev_day. Perhaps you had even implemented them before yourself! Good thing Rails will have them out of the box now :)

has_secure_token in Active Record

Rails will ship with a new Active Record macro for generating base 58 tokens out of the box. There's probably a large amount of applications already using this feature. As of the next major release you won't need to add another dependency or implement it yourself.

Fixed

More conventional filenames for mailers

Mailer generators now appends the _mailer suffix in the filename just like controller and jobs generators.

Rails 5.0 deprecations clean up

This week Rails got some more love with this major clean up (339 additions and 1,433 deletions) on its master branch. There's still some deprecations left though as the team figures how to best address them.

One More Thing™

Automatic type casting deprecated in Arel

Watch out library authors! Sean Griffin put a lot of effort into improving Arel extensibility. Please get in touch with him if you need APIs to help your use case. (See also these follow-up commits.)

Wrapping up

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

P.S. If you enjoyed this newsletter, why not share it with your friends? :) If you wish to be part of this project please don't hesitate to contact Godfrey – there're a lot of ways you could help make this newsletter more awesome!

[ANN] Rails 4.1.9 and 4.0.13 have been released!

Hi everyone,

I am happy to announce that Rails 4.1.9 and 4.0.13 have been released.

This will be also the last release of 4.0 series as announced in a previous blog post.

As per our maintenance policy, the release of Rails 4.2.0 means bug fixes will only apply to 4-2-stable, regular security issues to 4.2.x, 4.1.x, and severe security issues to 4.2.x, 4.1.x, and 3.2.x. In addition to these already stated commitments, I agreed to also apply bug fixes to 4-1-stable until the Rails 5 release.

As before, we will announce in a future blog post when we will drop bug fixes support for Rails 4.1.

CHANGES since 4.0.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.1.8

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.0.13:

$ shasum *4.0.13*
75f128ffb5813f6ec895a2f6c000a18531232bfb  actionmailer-4.0.13.gem
7356b2d90904ea3e5854a5fd5c969ff5521ee6bf  actionpack-4.0.13.gem
019bc6e77c2c430e52d93642bee8ad137ec288d8  activemodel-4.0.13.gem
fb367963994f153f68b904b8508b215b60a6a0ca  activerecord-4.0.13.gem
55cbd61d330d29fac50249d5ab9964e34a102f44  activesupport-4.0.13.gem
e4d679c792f0a2faafe69fd87217320bc318fc03  rails-4.0.13.gem
856d1f60df48479c4faba3de6d3ffcfadeee2f6b  railties-4.0.13.gem

Here are the checksums for 4.1.9:

$ shasum *4.1.9*
7d4a8ce21aa0429ec5fc05c64e2f64fa769a1c4a  actionmailer-4.1.9.gem
37b3990b77669877ab675124662ca5c0e880e556  actionpack-4.1.9.gem
baf6c54a9f411e9399dc7f9ad99aaa892a43293a  actionview-4.1.9.gem
cd9c214923ea0094fb65825b1866c3bc5b80fbdb  activemodel-4.1.9.gem
330a753ec001e38834406c464e306c3c43e276b5  activerecord-4.1.9.gem
66904e1371b047348d0247c43b9f1c3c596671bf  activesupport-4.1.9.gem
12a8b208566f4c822cc9199f51f60fd8baf010bc  rails-4.1.9.gem
2c494849ac54b8b3238d23fe62c81da37ca08e1b  railties-4.1.9.gem

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