port https://github.com/Plinq/pgcrypto/commit/fd663c5:
More changes to make the gem rails 4 compatible
by @mhenrixon.