Skip to content

Commit

Permalink
Merge branch 'use_rails_6_bulk_insert'
Browse files Browse the repository at this point in the history
  • Loading branch information
sskirby committed Oct 3, 2020
2 parents 3e06d12 + 9ae6a6d commit 77eb7d9
Show file tree
Hide file tree
Showing 13 changed files with 238 additions and 106 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
*.a
mkmf.log
/projectFilesBackup
.tool-versions
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.0
2.7.1
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
- postgresql
matrix:
include:
- rvm: 2.5.7
- rvm: 2.5
gemfile: gemfiles/rails_5_1.gemfile
- rvm: 2.6
gemfile: gemfiles/rails_5_1.gemfile
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,11 @@ It also does not do some things that you might expect from other ORMs:
1. Only supports PostgreSQL.

## Future Enhancements
* Aggregate updated_at.
* Support for other DBMSs (no MySQL support until ids can be generated without inserting into a table!)
* Support for other ORMs.
* Value objects.
* Remove dependency on ActiveRecord (optimistic locking? updated_at, created_at support? Data type conversions? TimeZone support?)
* More efficient updates (use fewer queries.)
* Support for UUID primary keys.
* Nicer DSL for specifying attributes that have different names in the domain model than in the DB.
* Show how to implement POROs without using Virtus (it is unsupported and can be crazy slow)
* Aggregate updated_at.
* Better support for value objects.

## FAQ

Expand Down Expand Up @@ -230,6 +228,10 @@ For example, use the [#query](https://rubydoc.info/github/nulogy/vorpal/master/V

**A.** You can use [ActiveModel::Serialization](http://api.rubyonrails.org/classes/ActiveModel/Serialization.html) or [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) but they are not heartily recommended. The former is too coupled to the model and the latter is too coupled to Rails controllers. Vorpal uses [SimpleSerializer](https://github.com/nulogy/simple_serializer) for this purpose.

**Q.** Are `updated_at` and `created_at` supported?

**A.** Yes. If they exist on your database tables, they will behave exactly as if you were using vanilla ActiveRecord.

## Contributing

1. Fork it ( https://github.com/nulogy/vorpal/fork )
Expand Down
53 changes: 25 additions & 28 deletions gemfiles/rails_5_1.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
vorpal (1.0.3)
vorpal (1.1.0)
activesupport
equalizer
simple_serializer (~> 1.0)
Expand All @@ -22,7 +22,7 @@ GEM
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
appraisal (2.2.0)
appraisal (2.3.0)
bundler
rake
thor (>= 0.14.0)
Expand All @@ -31,49 +31,46 @@ GEM
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
codecov (0.1.16)
codecov (0.2.11)
json
simplecov
url
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.1.5)
concurrent-ruby (1.1.7)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.3)
diff-lcs (1.4.4)
docile (1.3.2)
equalizer (0.0.11)
i18n (1.8.2)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
json (2.3.0)
minitest (5.14.0)
json (2.3.1)
minitest (5.14.2)
pg (0.18.4)
rake (13.0.1)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.1)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.3)
simple_serializer (1.0.2)
simplecov (0.17.1)
simplecov (0.19.0)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
thor (0.20.0)
simplecov-html (~> 0.11)
simplecov-html (0.12.3)
thor (1.0.1)
thread_safe (0.3.6)
tzinfo (1.2.6)
tzinfo (1.2.7)
thread_safe (~> 0.1)
url (0.3.2)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
Expand All @@ -98,4 +95,4 @@ RUBY VERSION
ruby 2.6.3p62

BUNDLED WITH
1.17.2
1.17.3
65 changes: 31 additions & 34 deletions gemfiles/rails_5_2.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
PATH
remote: ..
specs:
vorpal (1.0.3)
vorpal (1.1.0)
activesupport
equalizer
simple_serializer (~> 1.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (5.2.4.1)
activesupport (= 5.2.4.1)
activerecord (5.2.4.1)
activemodel (= 5.2.4.1)
activesupport (= 5.2.4.1)
activemodel (5.2.4.4)
activesupport (= 5.2.4.4)
activerecord (5.2.4.4)
activemodel (= 5.2.4.4)
activesupport (= 5.2.4.4)
arel (>= 9.0)
activerecord-import (0.13.0)
activerecord (>= 3.0)
activesupport (5.2.4.1)
activesupport (5.2.4.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
appraisal (2.2.0)
appraisal (2.3.0)
bundler
rake
thor (>= 0.14.0)
Expand All @@ -31,49 +31,46 @@ GEM
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
codecov (0.1.16)
codecov (0.2.11)
json
simplecov
url
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.1.5)
concurrent-ruby (1.1.7)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.3)
diff-lcs (1.4.4)
docile (1.3.2)
equalizer (0.0.11)
i18n (1.8.2)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
json (2.3.0)
minitest (5.14.0)
json (2.3.1)
minitest (5.14.2)
pg (0.18.4)
rake (13.0.1)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.1)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.3)
simple_serializer (1.0.2)
simplecov (0.17.1)
simplecov (0.19.0)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
thor (0.20.0)
simplecov-html (~> 0.11)
simplecov-html (0.12.3)
thor (1.0.1)
thread_safe (0.3.6)
tzinfo (1.2.6)
tzinfo (1.2.7)
thread_safe (~> 0.1)
url (0.3.2)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
Expand All @@ -98,4 +95,4 @@ RUBY VERSION
ruby 2.6.3p62

BUNDLED WITH
1.17.2
1.17.3
55 changes: 26 additions & 29 deletions gemfiles/rails_6_0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,84 +1,81 @@
PATH
remote: ..
specs:
vorpal (1.0.3)
vorpal (1.1.0)
activesupport
equalizer
simple_serializer (~> 1.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (6.0.2.1)
activesupport (= 6.0.2.1)
activerecord (6.0.2.1)
activemodel (= 6.0.2.1)
activesupport (= 6.0.2.1)
activerecord-import (1.0.4)
activemodel (6.0.3.3)
activesupport (= 6.0.3.3)
activerecord (6.0.3.3)
activemodel (= 6.0.3.3)
activesupport (= 6.0.3.3)
activerecord-import (1.0.6)
activerecord (>= 3.2)
activesupport (6.0.2.1)
activesupport (6.0.3.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2)
appraisal (2.2.0)
zeitwerk (~> 2.2, >= 2.2.2)
appraisal (2.3.0)
bundler
rake
thor (>= 0.14.0)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
codecov (0.1.16)
codecov (0.2.11)
json
simplecov
url
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.1.5)
concurrent-ruby (1.1.7)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.3)
diff-lcs (1.4.4)
docile (1.3.2)
equalizer (0.0.11)
i18n (1.8.2)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
json (2.3.0)
minitest (5.14.0)
pg (1.2.2)
json (2.3.1)
minitest (5.14.2)
pg (1.2.3)
rake (13.0.1)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.1)
rspec-support (~> 3.9.1)
rspec-expectations (3.9.0)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.2)
rspec-support (3.9.3)
simple_serializer (1.0.2)
simplecov (0.17.1)
simplecov (0.19.0)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
simplecov-html (~> 0.11)
simplecov-html (0.12.3)
thor (1.0.1)
thread_safe (0.3.6)
tzinfo (1.2.6)
tzinfo (1.2.7)
thread_safe (~> 0.1)
url (0.3.2)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
zeitwerk (2.2.2)
zeitwerk (2.4.0)

PLATFORMS
ruby
Expand Down
Loading

0 comments on commit 77eb7d9

Please sign in to comment.