active_record_upsert

Real upsert for PostgreSQL 9.5+ and Rails 5+ / ActiveRecord 5+. Uses ON CONFLICT DO UPDATE.