active_record_upsert 0.10.0 → 0.10.1
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e985d64fa74dedda4c75a2d8fb61f91e7ca89eca2d4c6e6c1bc62f9bf8c0499c
|
4
|
+
data.tar.gz: 3acce358c953805747e39c96d1028ed92715c38ac90a07f744eb8e12f76c278a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aea0bae90f0a51b27a1b3b8e24ad7bdf59c26a80433f4997892f7f5b1d1ea616f1b70731e56f052b7c9d7241b397f0613a6e2e8d0854021ba97c5ea623ab37af
|
7
|
+
data.tar.gz: 0c9ca9e4d570cbb4741cdd34feb71bc4b236a09c263dfc4c65a0d6092a63ec1c2a776a49cb4e64386f03e7d46502b6140ab3792b5b755c2a1e809a94cc866114
|
@@ -0,0 +1,51 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches: [$default-branches]
|
6
|
+
push:
|
7
|
+
branches: [$default-branch]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
name: Test
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
services:
|
14
|
+
postgres:
|
15
|
+
images: postgres
|
16
|
+
env:
|
17
|
+
POSTGRES_DB: upsert_test
|
18
|
+
POSTGRES_PASSWORD: postgres
|
19
|
+
POSTGRES_USER: postgres
|
20
|
+
options: >-
|
21
|
+
--health-cmd pg_isready
|
22
|
+
--health-interval 10s
|
23
|
+
--health-timeout 5s
|
24
|
+
--health-retries 5
|
25
|
+
ports:
|
26
|
+
- 5432:5432
|
27
|
+
|
28
|
+
strategy:
|
29
|
+
fail-fast: false
|
30
|
+
matrix:
|
31
|
+
ruby-version: [2.5.x, 2.6.x, 2.7.x]
|
32
|
+
gemfile: [Gemfile, Gemfile.rails-master, Gemfile.rails-6-1, Gemfile.rails-5-2, Gemfile.rails-5-1, Gemfile.rails-5-0]
|
33
|
+
|
34
|
+
steps:
|
35
|
+
- uses: actions/checkout@v2
|
36
|
+
|
37
|
+
- name: Prepare database
|
38
|
+
run: |
|
39
|
+
createdb --echo -U $POSTGRES_USER $POSTGRES_DB
|
40
|
+
psql -U $POSTGRES_USER $POSTGRES_DB < spec/dummy/db/structure.sql
|
41
|
+
|
42
|
+
- name: Set up Ruby
|
43
|
+
uses: ruby/setup-ruby@v1
|
44
|
+
with:
|
45
|
+
ruby-version: ${{ matrix.ruby-version }}
|
46
|
+
bundler-cache: true
|
47
|
+
env:
|
48
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
49
|
+
|
50
|
+
- name: Run Tests
|
51
|
+
run: bundle exec rake spec
|
data/README.md
CHANGED
@@ -241,3 +241,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/jesjos
|
|
241
241
|
- Emmanuel Quentin ([@manuquentin](https://github.com/manuquentin))
|
242
242
|
- Jeff Wallace ([@tjwallace](https://github.com/tjwallace))
|
243
243
|
- Kirill Zaitsev ([@Bugagazavr](https://github.com/Bugagazavr))
|
244
|
+
- Nick Campbell ([@nickcampbell18](https://github.com/nickcampbell18))
|
@@ -30,6 +30,7 @@ module ActiveRecordUpsert
|
|
30
30
|
values = self.class._upsert_record(existing_attributes, upsert_attribute_names, [arel_condition].compact, opts)
|
31
31
|
@attributes = self.class.attributes_builder.build_from_database(values.first.to_h)
|
32
32
|
@new_record = false
|
33
|
+
changes_applied
|
33
34
|
values
|
34
35
|
end
|
35
36
|
|
@@ -7,6 +7,7 @@ module ActiveRecordUpsert
|
|
7
7
|
values = self.class.unscoped.upsert(existing_attributes, upsert_attribute_names, [arel_condition].compact, opts)
|
8
8
|
@new_record = false
|
9
9
|
@attributes = self.class.attributes_builder.build_from_database(values.first.to_h)
|
10
|
+
changes_applied
|
10
11
|
values
|
11
12
|
end
|
12
13
|
|
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.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesper Josefsson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -59,6 +59,7 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
+
- ".github/workflows/ci.yml"
|
62
63
|
- Gemfile.base
|
63
64
|
- Gemfile.rails-5-0
|
64
65
|
- Gemfile.rails-5-1
|
@@ -112,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
113
|
- !ruby/object:Gem::Version
|
113
114
|
version: '0'
|
114
115
|
requirements: []
|
115
|
-
rubygems_version: 3.2.
|
116
|
+
rubygems_version: 3.2.7
|
116
117
|
signing_key:
|
117
118
|
specification_version: 4
|
118
119
|
summary: Real PostgreSQL 9.5+ upserts using ON CONFLICT for ActiveRecord
|