This week in Rails: Don't Miss Our Black Friday and Cyber Monday Deals!

Hello everyone!

This is Godfrey, bringing you the latest news deals in Rails. Have you been holding out on getting the latest copy of Rails? Don’t wait any longer as we are having our biggest sale of the year this weekend. Check out these unbelievable deals before they are gone!

🆓 RailsConf Tickets Giveaway

Limited Time Offer! Enter the RailsConf Tickets Giveaway (a.k.a. the Call For Proposals) by submitting a talk proposal! If your talk is selected, you will win a FREE admission to the conference!

Terms and conditions apply, see website for details.

🆓 Lifetime Rails Contributor Membership

As Seen On The Interwebs! Start collecting points like these 25 individuals with our award-winning rewards program. To apply for your FREE membership, simply submit a pull request to Rails. Membership never expires!

New Stuff

🆓 PostgreSQL Geometric Types Support

In-Store Only! Get FREE support for PostgreSQL data types (such as line, path and polygon) in schema.rb when you upgrade to Rails 5.

🆓 Certificate of Origin

Bonus Upgrade Offer! Rails 5 apps will be equipped with a FREE Origin header check if one is present in the request. When upgrading, existing apps will be given an option to enable the security feature at no additional cost.

Improved

🆓 Source Code Extraction

NOT A Pricing Error! If something went wrong in an AJAX request, Rails will now throw in the extracted source code in plaintext for FREE, making things easier to read in your browser’s console.

🆓 Dead Code Removal

Everything Must Go! As part of our clearance, a piece of dead code was discovered and promptly set FREE. No wonder everyone is so excited!

Fixed

🆓 Race Condition Protection

While Supplies Last! When the Evented File-System Monitoring project landed on master, a contributor pointed out a potential race condition. After ( a few attempts, we have finally arrived at a solution to FREE us from the danger!

Correction

🆓 byebug Upgrade Program

Manufacturer Rebate! In the last issue, we recommended byebug 7.0. Turns out the latest version is actually 8.2.1 (as of this week), which addressed some issue with the 7.0 release.

To compansate you for the trouble, we decided to offer a FREE byebug upgrade program for our readers. Simply change your Gemfile entry accordingly and run bundle install, and our agents will make sure the library is upgraded.

Wrapping Up

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

Until next time!

This week in Rails: RailsConf 2016, frozen Hash keys, faster byebug and more!

Hi everyone! This is Godfrey bringing you the latest news from Rails.

RailsConf 2016

The RailsConf 2016 website is up! This year, we will be gathering in Kansas City from May 4 to May 6. If you would like to submit a talk, the call for proposals (CFP) is open from now until Jan 15!

This Week’s Rails Contributors

This week we have seen commits from 29 different contributors in the Rails repository, including 6 new faces!

Improved

Frozen FK Names For Association

When you use a non-frozen (i.e. mutable) string as a Hash key, Ruby would have to duplicate and freeze it in order to guarantee a stable hash key.

This is usually fine, but when that string is used to build many different hashes, the work adds up. Fortunately, we can simply freeze it upfront to avoid the repeated work.

Faster byebug

byebug 7.0 has recently been released with some major performance improvements. (See this pull request for details.) If you are using byebug for debugging, you might want to upgrade!

Speeding Up Enumerable#sum

Did you know that Enumerable#{inject,reduce} can take a symbol as its argument? Apparently, this is slightly faster too! (Note: this is different from inject(&:method) which goes through Symbol#to_proc.)

Fixed

Use Instead Of +…+ In Docs

Usually, you can use +some_word+ to switch to fixed-width fonts in Rails’ documentation. However, the parser for this rule would sometime fail in some more complex cases.

If you are not sure when to use which, be sure to check the guidelines, or just check the output locally by running rake rdoc.

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.

Until next time!

This week in Rails: new releases, exciting Rails 5 stuff and more!

Hey everyone - Tim here with another monster update with all the exciting Rails-related goings-on from this week.

Riding Rails: Snappier Development Mode in Rails 5

One of the nicest things about development mode in Rails has to be the sheer convenience of running on your latest revision on each request. This of course comes at a performance cost but is about to change: instead the filesystem will notify Rails asynchronously of any changes.

Rails 4.2.5 and 4.1.14 are here!

This week saw the release of both 4.2.5 and 4.1.14 versions of Rails. Go upgrade while they’re still hot!

This Week’s Rails Contributors

This week 33 fabulous people contributed to Rails. Check out the list of issues if you’d like to see your name up there.

New Stuff

New! days_in_year method added to Time

Now you can can call Time.days_in_year and, at the time of writing it will return 365. Call it next year and it will give you 366. Nice!

String#parameterize gets a preserve_case option

This change adds an option to Preserve-the-CASE of the string instead of casting-everything-to-lowercase when generating parameters.

Improved

Improve support for non Active Record associations on validation

Support for non-Active Record associations just got better by skipping marked_for_destruction? when going through validations if it’s not implemented, making it easier to define virtual associations.

Return a sized Enumerator from Hash#transform_values

You can now discover the size of a hash whose values have been transformed.

Fixed

Exclude views when fetching tables on all the connection adapters

This brings more consistency across the adapters where those for MySQL and SQLite would return views in addition to tables when calling #tables, where PostgreSQL would not. Now they all return tables, and no views.

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.

Until next time!

[ANN] Rails 4.2.5 and 4.1.14 have been released!

Hi everyone,

I am happy to announce that Rails 4.2.5 and 4.1.14 have been released.

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

CHANGES since 4.1.13

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

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

$ shasum *4.1.14*
5919a0cab01f7c3f8d5f0a6cff842892cce518dd  actionmailer-4.1.14.gem
20bb0227cbaa19eb98e874e95db2fd753222a587  actionpack-4.1.14.gem
fb6c11e671d1feaa8e87f9acd869905fec044009  actionview-4.1.14.gem
9ab9d3ba4d8a67d8b40e2cf43ac6e2e0d0334437  activemodel-4.1.14.gem
9e0911dcc1b63a3dd651f5cce2cca04cf2cbf2f7  activerecord-4.1.14.gem
0a1d85dda70b940ca15d3b61cd4dd7edf1414275  activesupport-4.1.14.gem
146ac389047574a995dda86d464788c6c742ae02  rails-4.1.14.gem
d09a0fb9d9c66119f990afa0441eaebdbcbafa51  railties-4.1.14.gem

Here are the checksums for 4.2.5:

$ shasum *4.2.5*
bddfd0c5032babc04a6b6d096a19195a4fde8581  actionmailer-4.2.5.gem
21f3ccbfa63d6a97ea5c3a9ae816388e138d767a  actionpack-4.2.5.gem
1295aae8a8b5389b3e067ba937abecbd2a61eacf  actionview-4.2.5.gem
9583de133e9fe152ba36491ec0a8255d73416503  activejob-4.2.5.gem
f93fcd7979a4a8370783a88535d4409e70dbb3d1  activemodel-4.2.5.gem
c7c3466b4c6866577b18c4e1238c5db1f6bfdd03  activerecord-4.2.5.gem
454eb06a069f82d5830232edde40c14fd0f1cc3c  activesupport-4.2.5.gem
95b0fa311e719893165ae33c8378580b6da5e485  rails-4.2.5.gem
672b88b0d54b48f71893a99e581032054d688e70  railties-4.2.5.gem

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

Snappier Development Mode in Rails 5

In Rails 5 development mode is going to be a tad snappier for large code bases.

As you know, when a request comes in Rails reloads1 applications in development mode2 if something has changed. The way this is done has evolved over the years.

For a long time Rails simply reloaded unconditionally in every request.

Rails 3.2 improved that with the implementation of a file system monitor which (mod details) walks the application tree on every request checking mtimes.

That tree walk is done per request, not per page view. In particular, it happens when serving each one of the assets so, albeit walking an application tree once may not be a big deal, it may add up depending on the number of assets and how large is your code base.

Rails 5 is going to ship also with an evented file system monitor. When something changes the operating system calls Rails asynchronously and a flag is toggled. When a request comes in, the flag is checked, done.

This monitor is disabled by default, applications may opt-in just loading the listen gem in their Gemfile:

group :development do
  gem 'listen', '~> 3.0.4'
end

On Linux and Mac OS X there are no additional dependencies, but some are required for *BSD and for Windows. Note that some setups are unsupported.

Even if the evented monitor is enabled, the console still needs manual reload because it could be surprising that classes change behind the scenes while there are objects already instantiated. Better be explicit.

Thanks to Puneet Agarwal, who wrote the initial patch for this feature as part of this year’s GSoC.

Also kudos to the listen authors and maintainers, thanks to listen this was infinitely easier to implement in a portable way.


1 For a technical explanation of what “reloading” means please check the Autoloading and Reloading Constants guide.

2 Technically when config.cache_classes is false.

This week in Rails: new release candidates, concurrent migrations and more!

####

Hi there everyone o/

Washington here putting together another weekly Rails issue for the most awesome community.

Rails 4.2.5.rc2 and Rails 4.1.14.rc2 are out

Please take a minute or two to update your project Gemfile and run the build on the RCs. Spotting regressions now means they’re fixed in another RC rather than a new point release some month(s) away.

This Week’s Rails Contributors

As of 17h15min, UTC -3, 28 contributors made their commits to Rails master. Some of those for the very first time. Welcome!

Make migrations concurrent safe (using advisory locks)

MySQL and Postgres Active Record adapters were enhanced to avoid confusing behaviour or exceptions when running migrations on multi-instance clusters. See the issue as well for more details.

New Stuff

Add enabled flag to public_file_server settings

Good old serve_static_files is being deprecated as of Rails 5 in favor of public_file_server.enabled so we have all static asset options under the same public_file_server key.

Improved

Deprecate exception#original_exception in favor of exception#cause

Exception wrapping implementation got a bit simpler this week by using Ruby’s built in Exception#cause, available since version 2.1.

Require only necessary concurrent-ruby classes

Another concurrent-ruby bump and related load time improvements.

Don’t allow arbitrary data in :back urls

This was reported quite a while ago, but now someone stepped up to the plate and followed it through. Rails got a bit safer again, thanks to the community. ❤️

Allow passing an env to config_for

Sanity checking configuration files in other environments just got easier as well.

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.

Until next time!

[ANN] Rails 4.2.5.rc2 and 4.1.14.rc2 have been released!

Hi everyone,

I am happy to announce that Rails 4.2.5.rc2 and 4.1.14.rc2 have been released.

If no regressions are found expect the final release this Wednesday, on November 11, 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.13

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

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

$ shasum *4.1.14.rc2*
7c546616f87939a01807a55e78ed8494acc7c2ec  actionmailer-4.1.14.rc2.gem
8f80145fa65746c8a0a5492ae6213f447bbb0aaa  actionpack-4.1.14.rc2.gem
f0186571e89372ffbea47fbc4a3b901e46b0760e  actionview-4.1.14.rc2.gem
558e4eabcd1cec6a5089348dfd5a6f949d7606cc  activemodel-4.1.14.rc2.gem
0db20360a75bfa74b6539df190af8920bd75ff2f  activerecord-4.1.14.rc2.gem
3a2608827b895234e3d3b99e95df29344e31f875  activesupport-4.1.14.rc2.gem
5a9bd84dbc15a06128fc71d197cd6ee3d783114a  rails-4.1.14.rc2.gem
742da45dc3d63b43c882d7ce1d71f682bd1149c0  railties-4.1.14.rc2.gem

Here are the checksums for 4.2.5.rc2:

$ shasum *4.2.5.rc2*
d8fa2707c7f88aaf033b6ef2f0e39b5805823a8b  actionmailer-4.2.5.rc2.gem
80e43409399bcf3377c4a1aab803c442a635cadb  actionpack-4.2.5.rc2.gem
21d4a14dfec4ccfb321d51c1a73854f7c90003e0  actionview-4.2.5.rc2.gem
c1e258c2ed4b4e91b6d2f31d1a2020179043b5ba  activejob-4.2.5.rc2.gem
72f86e0ccb22e1b0f2980b500f1d7ced4d887da1  activemodel-4.2.5.rc2.gem
dc8cbcd461f3d3b583ac18c2d3c4fc5a8857ce72  activerecord-4.2.5.rc2.gem
40b5b72140f30bc97b7dc9e30c12d86ade0692b8  activesupport-4.2.5.rc2.gem
d3b7ee2ef71d9a9a4cb0a237162a67393549eeed  rails-4.2.5.rc2.gem
5969ef6ef00239fb5d2b012eb23068f1620a2563  railties-4.2.5.rc2.gem

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

This spooky week in Rails: bidirectional destroys, indexed errors and horror!

####

Beware of those,
In forests reigned by cawing crows
Who feel the fright, a stormy friday night

Your weekly Rails news, pick and choose
As we weave, this;
All Hallow’s Eve

Bet you didn’t expect to get spooked the day before Halloween, well, that’s our trick-a-trété. What? That’s what the french say — don’t ask.

This Week’s Rails Contributors

This week 42 contributors gathered in the town square, pitchforks in hand, and chased bugs out of Rails and up the mill.

That’s what mob programming is all about. I assume.

Bidirectional Destroys

Say, a USA and a USSR model employed defensive measures to destroy the other if they we’re destroyed. Before they’d keep destroying the other, now they’re more peaceful only destroying each other once. Good thing it’s a fictional example 😁

Nested attributes indexes errors by insertions

Have models with accepts_nested_attributes_for? The macro nestled out an index_errors option, so errors attach to a specific model in the submitted array.

There’s comments on the pull request, if you want to improve it further.

New Stuff

Relation gets left_outer_joins

There’s now an explicit way to do this specific join — abstracted away in includes before.
For those who want to be left out, er… join in!

Improved

Many to many relationships count a little more

While calling count on a has_and_belongs_to_many relationship was correctly counted, amping up the inclusion made threw off the count. Now you can use includes and have things counted correctly again.

Sanitizing Order

You’d have to remember to sanitize arguments you passed to order, which, if you have an example like the one in the pull request, is a pain. No more.

HashWithIndifferentAccess defaults with to_hash objects

Passing an object that responds to to_hash to HashWithIndifferentAccess.new now respects the default values and default proc if any of those are there.

One more thing™

Correction: Active Support delegation to block, args or arg

Last week, we incorrectly said this change would raise exceptions. What really happens is delegate now works with block, args or arg if those light your Jack-o’-lantern.

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.

Until next time!

Also if you really want to be scared, look yourself in the mirror! Boom, nailed it!

[ANN] Rails 4.2.5.rc1 and 4.1.14.rc1 have been released!

Hi everyone,

I am happy to announce that Rails 4.2.5.rc1 and 4.1.14.rc1 have been released.

If no regressions are found expect the final release this Wednesday, on November 4, 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.13

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

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

$ shasum *4.1.14.rc1*
6c4513c4f2a57d11fe8e9abafacde175a284a0fc  actionmailer-4.1.14.rc1.gem
27eeb9c788be0323eb459edda2b4d09418f37c40  actionpack-4.1.14.rc1.gem
2f70d52109b8be2c2dfbc57992fb1070a3a49fc5  actionview-4.1.14.rc1.gem
d3aafc6b61999fa0c9a363dfc626c93df9e460a2  activemodel-4.1.14.rc1.gem
55ea63bcca5925652956d194e8dbf4aca1780888  activerecord-4.1.14.rc1.gem
f771aa7d47c8a390449f577024d9335f7487294e  activesupport-4.1.14.rc1.gem
b3a16b8372ec44927196d38a12cc72fc97ad54c8  rails-4.1.14.rc1.gem
f1be582957f2494e13462f464e28afbaf938d233  railties-4.1.14.rc1.gem

Here are the checksums for 4.2.5.rc1:

$ shasum *4.2.5.rc1*
95125668842661dda2db412a45226f9b1219b522  actionmailer-4.2.5.rc1.gem
d9c6b7e38f9eab5975ca2549cb88b6700a0acdfd  actionpack-4.2.5.rc1.gem
f40ad9c7a5cd2c4b14f96615fdf5627d4fcaa9f3  actionview-4.2.5.rc1.gem
edcc197c162d64d663cf1049851105777c9a41ff  activejob-4.2.5.rc1.gem
eff7203c26da06c76a667428c70dc8741afac67e  activemodel-4.2.5.rc1.gem
c719ffeaffbd0f3bc1e23ed1db32df84662c0460  activerecord-4.2.5.rc1.gem
311d02a075d1669eba52b026ac60b834e02e96c6  activesupport-4.2.5.rc1.gem
810f02ff2930062f269340bc7df4e4e213a168a3  rails-4.2.5.rc1.gem
e7f842b19b4e3f67625d3df3127ed99392f19bed  railties-4.2.5.rc1.gem

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

Matthew joins Rails core; José joins Rails alumni

Please join us in welcoming Matthew Draper to the Rails core team!

Matthew is a kick-ass collaborator. He’s gone above and beyond PRs and technical contributions (which are sharp and on-point) by mentoring student groups, by coaching beginning Rails developers through their first apps alongside experienced developers working through design decisions & tradeoffs, by volunteering forserving on the Rails security team, and by emerging as a natural steward of the Rails way. His mindfulness for programmer experience & happiness puts Rails—the framework and our community—in good hands. Welcome, Matthew! 👏

Also, please join us in ushering José Valim into the halls of Rails alumni. José was once a Rails patch monster without peer, and has gone on to create the Elixir programming language and build a fantastic community around it. Gratefully, for everything: Thank you, José. ❤️