New features in Rails 4.2.9

Rails 4.2.9 released at last
14 June 2017   1300

Finally, RoR 4.2.9 has been released. This is going to be last update release of 4.2 series, so make sure to test this version properly.


Framework written in the Ruby programming language

If no issue will be found, final release is expected at Monday, 19th of June. 

Changes since 4.2.8

To read about the changes for each gem, please read the changelogs:

  • Action Mailer CHANGELOG
  • Action Pack CHANGELOG
  • Action View CHANGELOG
  • Active Job CHANGELOG
  • Active Model CHANGELOG
  • Active Record CHANGELOG
  • Active Support CHANGELOG
  • Railties CHANGELOG

You can view full list of changes here.

Nowadays, most of the new Rails projects are being created using Rails 5. But 4 series is also supported due to big amount of large projects that was created using it. Updates of Rails 4 series are not global, they just fix small issues and bugs.

Dmitry Karpunin
Chief Front-End Developer at Evrone


Here are the checksums for 4.2.9.rc1:

$ shasum -a 256 *-4.2.9.rc1.gem
f989619bd008bb131ac51c9523a67cf07b04fd02ccbb6a4c862a7e91399abf29  actionmailer-4.2.9.rc1.gem
ce36a4c32d738bdf0f225c427ed7e31c2e681004fa827f7bbe0c4bd05fb6b264  actionpack-4.2.9.rc1.gem
e815d4d9ee866145cf9ae78716fed8453a12eace055f4fbd80ae7f4b74e08d27  actionview-4.2.9.rc1.gem
b03d68ecc055160bc903055649bb47b57de09b68749bd6e40e2e4378cd9a3ce7  activejob-4.2.9.rc1.gem
734e28fff15f3319be32b6e3cba40519e7c730c88ba49f0b334eb1d63f32c872  activemodel-4.2.9.rc1.gem
a2f25b8132cca325bf855d7e45c809a122282d8e65f3d6580e40da624c71996a  activerecord-4.2.9.rc1.gem
7b3b69479110a64f50ac53681f076b5ec21a073b1120c9d7ab201eec0af09d12  activesupport-4.2.9.rc1.gem
c7de4f0e62498acf407928a5f147a9e297a63e900882f627489e91b033026b69  rails-4.2.9.rc1.gem
425e43203b35fa28dd9708848c4aaa11706c53fcd75819228a92e6893653f8da  railties-4.2.9.rc1.gem

You can use it to verify your version of the gem.

DateTime, Timestamp, Time and Date in Rails

Learn about key differenece between DateTime, Timestamp, Time and Date in Rails
31 October 2017   626

The difference between different date/time formats in ActiveRecord have little to do with Rails and everything to do with whatever database you're using.

Using MySQL as an example (if for no other reason because it's most popular), you have DATEDATETIMETIME and TIMESTAMP column data types; just as you have CHARVARCHARFLOATand INTEGER.

So, main differences: DATE only stores a date, TIME only stores a time of day, while DATETIME stores both.

The difference between DATETIME and TIMESTAMP is a bit more subtle: DATETIME is formatted as YYYY-MM-DD HH:MM:SS. Valid ranges go from the year 1000 to the year 9999 and everything in between. While TIMESTAMP looks similar when you fetch it from the database, it's really a just a front for a unix timestamp. Its valid range goes from 1970 to 2038. The difference here, aside from the various built-in functions within the database engine, is storage space. Because DATETIMEstores every digit in the year, month day, hour, minute and second, it uses up a total of 8 bytes. As TIMESTAMP only stores the number of seconds since 1970-01-01, it uses 4 bytes.

You can read more about the differences between time formats in MySQL here.

In the end, it comes down to what you need your date/time column to do. Do you need to store dates and times before 1970 or after 2038? Use DATETIME. Do you need to worry about database size and you're within that timerange? Use TIMESTAMP. Do you only need to store a date? Use DATE. Do you only need to store a time? Use TIME.

Having said all of this, Rails actually makes some of these decisions for you. Both :timestamp and :datetime will default to DATETIME, while :date and :time corresponds to DATE and TIME, respectively.