active_record_upsert 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17859791d0f8087ee15a23e7ba92b545228e5936
4
- data.tar.gz: 5ca52ebcbd5c9464425b59bf0e5d6c474e6c9374
3
+ metadata.gz: 829a433b3ee06729ebc770faa315c2b6fa7a0fbd
4
+ data.tar.gz: 36259382b3abcb4b91ea4acab61841cbb2df0d79
5
5
  SHA512:
6
- metadata.gz: 688ffdfffb32ff77e568e5bbdc37a4309ba154882a60c25ddea23c6fa67d22bee0b8907b186608d0a6bf3998728bf815a3baf0ce5c78bc8f504606b428a0baef
7
- data.tar.gz: fdaa6610407f72f51950672a93026162095483daba7ca78cc46ee494ea9b834cfe348a6f2e1531f3ea2911ee0e376e43d63fa3e45d60098d040a30b0236297fe
6
+ metadata.gz: 7c39b53f25dace28627ef418b09558f425f36dd7ef4bb0ef0480fb44dc6229d6087b0f084025f2063abdaf18d539412d69e9a81c24109657f1688dc658d03158
7
+ data.tar.gz: 856edaa5d0e708521539ecc3255da261ac44a6ecf308b34c4dc9f6d7e81f3076f0e23f67956d6b35f84c90210e885ede94e1c83c61c7c17435d5ab08e770b730
data/Gemfile CHANGED
@@ -3,7 +3,10 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in active_record_upsert.gemspec
4
4
  gemspec
5
5
 
6
- gem 'activerecord-jdbc-adapter', github: 'jensnockert/activerecord-jdbc-adapter', branch: 'activerecord-50'
6
+ gem 'activerecord-jdbc-adapter',
7
+ github: 'jensnockert/activerecord-jdbc-adapter',
8
+ branch: 'activerecord-50',
9
+ platform: :jruby
7
10
 
8
11
  gem 'activerecord-jdbcpostgresql-adapter',
9
12
  github: 'jensnockert/activerecord-jdbc-adapter',
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
+ [![Build Status](https://travis-ci.org/jesjos/active_record_upsert.svg?branch=master)](https://travis-ci.org/jesjos/active_record_upsert)
2
+ [![Code Climate](https://codeclimate.com/github/jesjos/active_record_upsert/badges/gpa.svg)](https://codeclimate.com/github/jesjos/active_record_upsert)
3
+
1
4
  # ActiveRecordUpsert
2
5
 
3
- Real upsert for PostgreSQL 9.5+ and ActiveRecord. Uses ON CONFLICT DO UPDATE.
6
+ Real upsert for PostgreSQL 9.5+ and ActiveRecord. Uses [ON CONFLICT DO UPDATE](http://www.postgresql.org/docs/9.5/static/sql-insert.html).
4
7
 
5
8
  ## Main points
6
9
 
@@ -0,0 +1,13 @@
1
+ module ActiveRecordUpsert
2
+ module ActiveRecord
3
+ module TransactionsExtensions
4
+ def upsert(*args)
5
+ rollback_active_record_state! do
6
+ with_transaction_returning_status { super }
7
+ end
8
+ end
9
+ end
10
+
11
+ ::ActiveRecord::Base.prepend(TransactionsExtensions)
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module ActiveRecordUpsert
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_upsert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesper Josefsson
@@ -145,6 +145,7 @@ files:
145
145
  - lib/active_record_upsert/active_record/persistence.rb
146
146
  - lib/active_record_upsert/active_record/relation.rb
147
147
  - lib/active_record_upsert/active_record/timestamp.rb
148
+ - lib/active_record_upsert/active_record/transactions.rb
148
149
  - lib/active_record_upsert/arel.rb
149
150
  - lib/active_record_upsert/arel/crud.rb
150
151
  - lib/active_record_upsert/arel/insert_manager.rb