active_record_upsert 0.3.0-java → 0.4.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -1
- data/README.md +4 -1
- data/lib/active_record_upsert/active_record/transactions.rb +13 -0
- data/lib/active_record_upsert/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c5957bd881deda09f1dabac7003948123b81b26
|
4
|
+
data.tar.gz: 3caac4e501d978ed1b6d389ae87d21b36b8d9204
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 765014d7a2a2a7119fdb3ff6c97efa7853f6b50ffb6b834a1f3d59daf0286e20a46e9253337cf94dba46ebe21a451872849a9ad0968e7c5bec91b95c3aeeb9e5
|
7
|
+
data.tar.gz: 229b110dfd3e3fa08899dc3d9979ae8fb7afd1d687670901fe09ce07cfd1b693a58d948d3da9d4707cfb4190bd1014b6b56a62ede4e0e223e96daf04e65cb025
|
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',
|
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
|
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: java
|
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
|