How do I use "UPSERT" or "INSERT INTO likes (user_id,person_id) VALUES (32,64) ON CONFLICT (user_id,person_id) DO NOTHING" in PostgreSQL 9.5 on Rails 4.2?
Have a look at active_record_upsert
gem here: https://github.com/jesjos/active_record_upsert. This does the upsert, but obviously only on Postgres 9.5+.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With