
Rails 4.2 released - chancancode
http://weblog.rubyonrails.org/2014/12/19/Rails-4-2-final/
======
jrochkind1
I think ActiveJob is a great thing, a real step forward to have a Rails-
endorsed API for this others can hook into on both sides. Awesome.

But am I the only one who gets a sort of pit in their stomach every time they
hear about a new Rails version? So many things to upgrade, so many
dependencies that might break, and then Rails 5 coming in less than 12 months
when I get to do it again, I have to admit the Rails treadmill is exhausting
me.

~~~
gareim
I just started learning Rails and haven't deployed yet, but the thought of
upgrading after deploying a project scares me a lot.

~~~
diasks2
I've found the best way to make upgrading easier is having good test coverage.
I think one of the biggest fears when upgrading is having something break but
not knowing that it is now broken. Although tests won't always catch
everything they are a great start to ease the upgrade process.

------
sergiotapia
The Rails team make so many developers happy worldwide, it's incredible. Thank
you from the bottom of my heart for making my job suck less.

\---

A quick questions regarding Foreign Key support, in the past I would use these
concepts normally but does this mean that before Rails did not use Foreign
Keys (in the strict rdbms sense)?

Does this mean that there are now easy performance gains if you're using their
new -real- foreign key support?

~~~
amalag
To your first question, Rails tried to enforce some constraints at the
application level, but it was lacking. I worked in a large production system
and for extra safeguards their were DB level foreign key constraints. They are
kind of a pain to unwind and make changes, but they can save your butt if you
accidentally delete something.

Second question: You can see this answer:
[http://stackoverflow.com/questions/507179/does-foreign-
key-i...](http://stackoverflow.com/questions/507179/does-foreign-key-improve-
query-performance)

~~~
ikawe
Read more about the shortcomings of application level reference validations
here: [http://robots.thoughtbot.com/referential-integrity-with-
fore...](http://robots.thoughtbot.com/referential-integrity-with-foreign-keys)

Note: that post talks about using `foreigner` gem which predates having
foreign key support in rails core.

------
amalag
Rails 4.2 does NOT work with JRuby.

There are pending issues on activerecord-jdbc:
[https://github.com/jruby/activerecord-jdbc-
adapter/issues/59...](https://github.com/jruby/activerecord-jdbc-
adapter/issues/599)

------
ghiculescu
I found [http://samsaffron.com/archive/2014/12/01/speeding-up-
rails-4...](http://samsaffron.com/archive/2014/12/01/speeding-up-rails-4-2)
(from the post's comments) interesting.

It looks like there were initially quite a few performance regressions in the
new release. Adequate Record looks great for rails scaffolds, but (at this
stage) doesn't look like it will very useful for production apps that
_probably_ have more complex queries. For example, it stops working if your
query has a `where`.

Big thanks to Sam et al for their work in speeding things up.

------
poppup
I have been using rails for many years now and I'm sad to say I'm leaving it
behind in my current/new project :( I will miss the familiar patterns and want
to express my gratitude to the team that makes _everything_ work so
seamlessly.

~~~
copperx
Which framework will you be using now?

------
gfodor
Congrats, and thanks so much for your hard work rails team.

------
MaxGabriel
Has anyone had issues upgrading? Alot of our tests that check a value from a
the session are failing; haven't been able to figure out why so far.

~~~
cpg
[https://github.com/binarylogic/authlogic/issues/432](https://github.com/binarylogic/authlogic/issues/432)

------
te_chris
Congratulations guys. I love working with a framework that is always getting
better, looking forward to deploying ActiveJob. GlobalID is great!

------
TallboyOne
I'm just waiting on Delayed Job at this point :)

~~~
xal
DJ could use a update to be fully Rails 4.2 compatible. I'd love a PR for that
and would merge.

[https://github.com/tobi/delayed_job](https://github.com/tobi/delayed_job)

~~~
reledi
The repo you linked to is dead. DJ is in active development at
[https://github.com/collectiveidea/delayed_job](https://github.com/collectiveidea/delayed_job).

------
reledi
Seasons greetings Rails team; thanks for the gifts.

------
ma2ge
Congrats!! I'd like to upgrade Rails 4.2 from 4.2.0.rc3, thanks!

------
izietto
Finally official foreign keys support \o/

------
andyl
Rails4.2 the day after Postgres9.4. A great combination.

Postgres9.4 has JsonB, Json, Hstore and Array fields. Rails4.2 fixes the
dirty-tracking for JsonB/Json/Hstore. Thank you developers!

~~~
jrochkind1
> Postgres9.4 has JsonB, Json, Hstore and Array fields. Rails4.2 fixes the
> dirty-tracking for JsonB/Json/Hstore.

Oh, I hadn't caught that, awesome! Can you link to docs and/or commit?

I'm wondering if it will do "partial updates" yet -- postgres supports, I
think for Json too but definitely for Hstore, a statement that says "just
update these keys with these values, leave the other key/values alone".

The reason you'd be interested in this is multi-client concurrency, so one
client updating some keys doesn't overwrite changes made at about the same
time by another client updating only other keys. Lets you use hstore/json in
certain circumstances of multi-process concurrency that otherwise you'd have
to use normalized separate rows for.

When I had tried to look at ActiveRecord on my own to figure out if I could
get it to do this, it seemed like it oughta be possible (AR is already
tracking the original value for dirty tracking, I think) but I never quite
could figure it out, how to hook into the SQL-generation to do it.

