schema_validations 2.2.1 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/prs.yml +173 -0
  3. data/.gitignore +1 -0
  4. data/.simplecov +20 -0
  5. data/Gemfile +5 -0
  6. data/README.md +33 -6
  7. data/Rakefile +2 -0
  8. data/gemfiles/Gemfile.base +1 -1
  9. data/gemfiles/activerecord-5.2/Gemfile.base +4 -0
  10. data/gemfiles/activerecord-5.2/Gemfile.mysql2 +10 -0
  11. data/gemfiles/activerecord-5.2/Gemfile.postgresql +10 -0
  12. data/gemfiles/{activerecord-4.2 → activerecord-5.2}/Gemfile.sqlite3 +3 -3
  13. data/gemfiles/activerecord-6.0/Gemfile.base +4 -0
  14. data/gemfiles/activerecord-6.0/Gemfile.mysql2 +10 -0
  15. data/gemfiles/activerecord-6.0/Gemfile.postgresql +10 -0
  16. data/gemfiles/{activerecord-5.0 → activerecord-6.0}/Gemfile.sqlite3 +3 -3
  17. data/gemfiles/activerecord-6.1/Gemfile.base +4 -0
  18. data/gemfiles/activerecord-6.1/Gemfile.mysql2 +10 -0
  19. data/gemfiles/activerecord-6.1/Gemfile.postgresql +10 -0
  20. data/gemfiles/activerecord-6.1/Gemfile.sqlite3 +10 -0
  21. data/gemfiles/activerecord-7.0/Gemfile.base +4 -0
  22. data/gemfiles/activerecord-7.0/Gemfile.mysql2 +10 -0
  23. data/gemfiles/activerecord-7.0/Gemfile.postgresql +10 -0
  24. data/gemfiles/activerecord-7.0/Gemfile.sqlite3 +10 -0
  25. data/init.rb +2 -0
  26. data/lib/schema_validations/active_record/type.rb +2 -0
  27. data/lib/schema_validations/active_record/validations.rb +2 -0
  28. data/lib/schema_validations/railtie.rb +2 -0
  29. data/lib/schema_validations/validators/not_nil_validator.rb +11 -3
  30. data/lib/schema_validations/version.rb +3 -1
  31. data/lib/schema_validations.rb +2 -0
  32. data/schema_dev.yml +8 -3
  33. data/schema_validations.gemspec +23 -27
  34. data/spec/spec_helper.rb +16 -22
  35. data/spec/support/active_model.rb +2 -0
  36. data/spec/validations_spec.rb +32 -20
  37. metadata +45 -95
  38. data/.travis.yml +0 -21
  39. data/gemfiles/activerecord-4.2/Gemfile.base +0 -3
  40. data/gemfiles/activerecord-4.2/Gemfile.mysql2 +0 -10
  41. data/gemfiles/activerecord-4.2/Gemfile.postgresql +0 -10
  42. data/gemfiles/activerecord-5.0/Gemfile.base +0 -3
  43. data/gemfiles/activerecord-5.0/Gemfile.mysql2 +0 -10
  44. data/gemfiles/activerecord-5.0/Gemfile.postgresql +0 -10
  45. data/spec/schema_validations.sqlite3 +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4d32813f578be832c807834e301af6646a5de2e8
4
- data.tar.gz: 8f6d05bc4a8ee9230d2db146823ffa87ac2b16a1
2
+ SHA256:
3
+ metadata.gz: 2ab55b81e765e8fb52d2775cdc56d28457a8210770bd78037fc8a05a5c1e3fa0
4
+ data.tar.gz: a3871e40d193076ad1e8e3144407fa0a87eba01764c96e74d3f35ac8dc61a776
5
5
  SHA512:
6
- metadata.gz: e41b110b12a186b3cacce1280ae74279e83b8b8be5296cdcedd43fe27fa258609ce79226b6b8c9cf0b034ac78633c319d696a76c6cc67d119119defb396edabd
7
- data.tar.gz: ae10f5ffc2434e9e0f4470225fed144f37bc217864f487c8b391df20836d43f42029136a75213b4117623199ec967a97f8f97f87bb804038885becdb2f090e22
6
+ metadata.gz: 452d43d12d06516b2667f601e3b49536a2d4e866a61a9391e2f925cfbbd1ce94b503442fd2cdce092327a93b1ae42c35e789639946680873bd7741a1d105421f
7
+ data.tar.gz: cb34384da433ae3ddb1a1318b4ad514f72d1b00c2bf6d28a422051b9e872f3f7797c44b10b3333b5845922ef60fd9fe3a242c9b01e40f86c49a007f0dd076566
@@ -0,0 +1,173 @@
1
+ # This file was auto-generated by the schema_dev tool, based on the data in
2
+ # ./schema_dev.yml
3
+ # Please do not edit this file; any changes will be overwritten next time
4
+ # schema_dev gets run.
5
+ ---
6
+ name: CI PR Builds
7
+ 'on':
8
+ push:
9
+ branches:
10
+ - master
11
+ pull_request:
12
+ concurrency:
13
+ group: ci-${{ github.ref }}
14
+ cancel-in-progress: true
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ ruby:
22
+ - '2.5'
23
+ - '2.7'
24
+ - '3.0'
25
+ - '3.1'
26
+ activerecord:
27
+ - '5.2'
28
+ - '6.0'
29
+ - '6.1'
30
+ - '7.0'
31
+ db:
32
+ - mysql2
33
+ - sqlite3
34
+ - skip
35
+ dbversion:
36
+ - skip
37
+ exclude:
38
+ - ruby: '3.0'
39
+ activerecord: '5.2'
40
+ - ruby: '3.1'
41
+ activerecord: '5.2'
42
+ - ruby: '2.5'
43
+ activerecord: '7.0'
44
+ - db: skip
45
+ dbversion: skip
46
+ include:
47
+ - ruby: '2.5'
48
+ activerecord: '5.2'
49
+ db: postgresql
50
+ dbversion: '9.6'
51
+ - ruby: '2.5'
52
+ activerecord: '6.0'
53
+ db: postgresql
54
+ dbversion: '9.6'
55
+ - ruby: '2.5'
56
+ activerecord: '6.1'
57
+ db: postgresql
58
+ dbversion: '9.6'
59
+ - ruby: '2.7'
60
+ activerecord: '5.2'
61
+ db: postgresql
62
+ dbversion: '9.6'
63
+ - ruby: '2.7'
64
+ activerecord: '6.0'
65
+ db: postgresql
66
+ dbversion: '9.6'
67
+ - ruby: '2.7'
68
+ activerecord: '6.1'
69
+ db: postgresql
70
+ dbversion: '9.6'
71
+ - ruby: '2.7'
72
+ activerecord: '7.0'
73
+ db: postgresql
74
+ dbversion: '9.6'
75
+ - ruby: '3.0'
76
+ activerecord: '6.0'
77
+ db: postgresql
78
+ dbversion: '9.6'
79
+ - ruby: '3.0'
80
+ activerecord: '6.1'
81
+ db: postgresql
82
+ dbversion: '9.6'
83
+ - ruby: '3.0'
84
+ activerecord: '7.0'
85
+ db: postgresql
86
+ dbversion: '9.6'
87
+ - ruby: '3.1'
88
+ activerecord: '6.0'
89
+ db: postgresql
90
+ dbversion: '9.6'
91
+ - ruby: '3.1'
92
+ activerecord: '6.1'
93
+ db: postgresql
94
+ dbversion: '9.6'
95
+ - ruby: '3.1'
96
+ activerecord: '7.0'
97
+ db: postgresql
98
+ dbversion: '9.6'
99
+ env:
100
+ BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord-${{ matrix.activerecord }}/Gemfile.${{ matrix.db }}"
101
+ MYSQL_DB_HOST: 127.0.0.1
102
+ MYSQL_DB_USER: root
103
+ MYSQL_DB_PASS: database
104
+ POSTGRESQL_DB_HOST: 127.0.0.1
105
+ POSTGRESQL_DB_USER: schema_plus_test
106
+ POSTGRESQL_DB_PASS: database
107
+ steps:
108
+ - uses: actions/checkout@v2
109
+ - name: Set up Ruby
110
+ uses: ruby/setup-ruby@v1
111
+ with:
112
+ ruby-version: "${{ matrix.ruby }}"
113
+ bundler-cache: true
114
+ - name: Run bundle update
115
+ run: bundle update
116
+ - name: Start Mysql
117
+ if: matrix.db == 'mysql2'
118
+ run: |
119
+ docker run --rm --detach \
120
+ -e MYSQL_ROOT_PASSWORD=$MYSQL_DB_PASS \
121
+ -p 3306:3306 \
122
+ --health-cmd "mysqladmin ping --host=127.0.0.1 --password=$MYSQL_DB_PASS --silent" \
123
+ --health-interval 5s \
124
+ --health-timeout 5s \
125
+ --health-retries 5 \
126
+ --name database mysql:5.6
127
+ - name: Start Postgresql
128
+ if: matrix.db == 'postgresql'
129
+ run: |
130
+ docker run --rm --detach \
131
+ -e POSTGRES_USER=$POSTGRESQL_DB_USER \
132
+ -e POSTGRES_PASSWORD=$POSTGRESQL_DB_PASS \
133
+ -p 5432:5432 \
134
+ --health-cmd "pg_isready -q" \
135
+ --health-interval 5s \
136
+ --health-timeout 5s \
137
+ --health-retries 5 \
138
+ --name database postgres:${{ matrix.dbversion }}
139
+ - name: Wait for database to start
140
+ if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
141
+ run: |
142
+ COUNT=0
143
+ ATTEMPTS=20
144
+ until [[ $COUNT -eq $ATTEMPTS ]]; do
145
+ [ "$(docker inspect -f {{.State.Health.Status}} database)" == "healthy" ] && break
146
+ echo $(( COUNT++ )) > /dev/null
147
+ sleep 2
148
+ done
149
+ - name: Create testing database
150
+ if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
151
+ run: bundle exec rake create_ci_database
152
+ - name: Run tests
153
+ run: bundle exec rake spec
154
+ - name: Shutdown database
155
+ if: always() && (matrix.db == 'postgresql' || matrix.db == 'mysql2')
156
+ run: docker stop database
157
+ - name: Coveralls Parallel
158
+ if: "${{ !env.ACT }}"
159
+ uses: coverallsapp/github-action@master
160
+ with:
161
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
162
+ flag-name: run-${{ matrix.ruby }}-${{ matrix.activerecord }}-${{ matrix.db }}-${{ matrix.dbversion }}
163
+ parallel: true
164
+ finish:
165
+ needs: test
166
+ runs-on: ubuntu-latest
167
+ steps:
168
+ - name: Coveralls Finished
169
+ if: "${{ !env.ACT }}"
170
+ uses: coverallsapp/github-action@master
171
+ with:
172
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
173
+ parallel-finished: true
data/.gitignore CHANGED
@@ -27,3 +27,4 @@ Gemfile.local
27
27
  Gemfile.lock
28
28
  gemfiles/*.lock
29
29
  gemfiles/**/*.lock
30
+ /.idea
data/.simplecov ADDED
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ SimpleCov.configure do
4
+ enable_coverage :branch
5
+ add_filter '/spec/'
6
+
7
+ add_group 'Binaries', '/bin/'
8
+ add_group 'Libraries', '/lib/'
9
+
10
+ if ENV['CI']
11
+ require 'simplecov-lcov'
12
+
13
+ SimpleCov::Formatter::LcovFormatter.config do |c|
14
+ c.report_with_single_file = true
15
+ c.single_report_path = 'coverage/lcov.info'
16
+ end
17
+
18
+ formatter SimpleCov::Formatter::LcovFormatter
19
+ end
20
+ end
data/Gemfile CHANGED
@@ -1,3 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "http://rubygems.org"
2
4
 
3
5
  gemspec
6
+
7
+ gemfile_local = File.expand_path '../Gemfile.local', __FILE__
8
+ eval File.read(gemfile_local), binding, gemfile_local if File.exist? gemfile_local
data/README.md CHANGED
@@ -5,8 +5,8 @@ definitions simpler and more DRY, by automatically defining validations based
5
5
  on the database schema.
6
6
 
7
7
  [![Gem Version](https://badge.fury.io/rb/schema_validations.svg)](http://badge.fury.io/rb/schema_validations)
8
- [![Build Status](https://secure.travis-ci.org/SchemaPlus/schema_validations.svg)](http://travis-ci.org/SchemaPlus/schema_validations)
9
- [![Coverage Status](https://coveralls.io/repos/SchemaPlus/schema_validations/badge.svg?branch=master&service=github)](https://coveralls.io/github/SchemaPlus/schema_validations)
8
+ [![Build Status](https://github.com/SchemaPlus/schema_validations/actions/workflows/pr.yml/badge.svg)](http://github.com/SchemaPlus/schema_validations/actions)
9
+ [![Coverage Status](https://coveralls.io/github/SchemaPlus/schema_validations/badge.svg)](https://coveralls.io/github/SchemaPlus/schema_validations)
10
10
 
11
11
 
12
12
  ## Overview
@@ -174,8 +174,19 @@ As of version 1.2.0, SchemaValidations supports and is tested on:
174
174
 
175
175
  <!-- SCHEMA_DEV: MATRIX - begin -->
176
176
  <!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
177
- * ruby **2.3.1** with activerecord **4.2**, using **mysql2**, **postgresql** or **sqlite3**
178
- * ruby **2.3.1** with activerecord **5.0**, using **mysql2**, **postgresql** or **sqlite3**
177
+ * ruby **2.5** with activerecord **5.2**, using **mysql2**, **postgresql:9.6** or **sqlite3**
178
+ * ruby **2.5** with activerecord **6.0**, using **mysql2**, **postgresql:9.6** or **sqlite3**
179
+ * ruby **2.5** with activerecord **6.1**, using **mysql2**, **postgresql:9.6** or **sqlite3**
180
+ * ruby **2.7** with activerecord **5.2**, using **mysql2**, **postgresql:9.6** or **sqlite3**
181
+ * ruby **2.7** with activerecord **6.0**, using **mysql2**, **postgresql:9.6** or **sqlite3**
182
+ * ruby **2.7** with activerecord **6.1**, using **mysql2**, **postgresql:9.6** or **sqlite3**
183
+ * ruby **2.7** with activerecord **7.0**, using **mysql2**, **postgresql:9.6** or **sqlite3**
184
+ * ruby **3.0** with activerecord **6.0**, using **mysql2**, **postgresql:9.6** or **sqlite3**
185
+ * ruby **3.0** with activerecord **6.1**, using **mysql2**, **postgresql:9.6** or **sqlite3**
186
+ * ruby **3.0** with activerecord **7.0**, using **mysql2**, **postgresql:9.6** or **sqlite3**
187
+ * ruby **3.1** with activerecord **6.0**, using **mysql2**, **postgresql:9.6** or **sqlite3**
188
+ * ruby **3.1** with activerecord **6.1**, using **mysql2**, **postgresql:9.6** or **sqlite3**
189
+ * ruby **3.1** with activerecord **7.0**, using **mysql2**, **postgresql:9.6** or **sqlite3**
179
190
 
180
191
  <!-- SCHEMA_DEV: MATRIX - end -->
181
192
 
@@ -187,6 +198,23 @@ Earlier versions of SchemaValidations supported:
187
198
 
188
199
  ## Release Notes
189
200
 
201
+ ### 2.4.1
202
+
203
+ * Add AR 6.1 and 7.0
204
+ * add ruby 3.1
205
+
206
+ ### 2.4.0
207
+
208
+ * Add AR 6.0
209
+ * Add Ruby 3.0
210
+ * Remove support for AR < 5.2
211
+ * Remove support for Ruby < 2.5
212
+
213
+ ### 2.3.0
214
+
215
+ * Works with AR 5.1.
216
+ * No longer testing rails 4.2
217
+
190
218
  ### 2.2.1
191
219
 
192
220
  * Bug fix: don't create presence validation for `null: false` with a
@@ -278,7 +306,7 @@ Some things to know about to help you develop and test:
278
306
  * **schema_dev**: SchemaValidations uses [schema_dev](https://github.com/SchemaPlus/schema_dev) to
279
307
  facilitate running rspec tests on the matrix of ruby, activerecord, and database
280
308
  versions that the gem supports, both locally and on
281
- [travis-ci](http://travis-ci.org/SchemaPlus/schema_validations)
309
+ [github actions](https://github.com/SchemaPlus/schema_validations/actions)
282
310
 
283
311
  To to run rspec locally on the full matrix, do:
284
312
 
@@ -290,7 +318,6 @@ Some things to know about to help you develop and test:
290
318
  The matrix of configurations is specified in `schema_dev.yml` in
291
319
  the project root.
292
320
 
293
-
294
321
  <!-- SCHEMA_DEV: TEMPLATE USES SCHEMA_DEV - end -->
295
322
 
296
323
  Code coverage results will be in coverage/index.html -- it should be at 100% coverage.
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler'
2
4
  Bundler::GemHelper.install_tasks
3
5
 
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
- gemspec :path => File.expand_path('..', __FILE__)
2
+ gemspec path: File.expand_path('..', __FILE__)
3
3
 
4
4
  File.exist?(gemfile_local = File.expand_path('../Gemfile.local', __FILE__)) and eval File.read(gemfile_local), binding, gemfile_local
@@ -0,0 +1,4 @@
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
3
+
4
+ gem "activerecord", ">= 5.2.0.beta0", "< 5.3"
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -1,5 +1,5 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
3
 
4
4
  platform :ruby do
5
5
  gem "sqlite3"
@@ -7,4 +7,4 @@ end
7
7
 
8
8
  platform :jruby do
9
9
  gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
- end
10
+ end
@@ -0,0 +1,4 @@
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
3
+
4
+ gem "activerecord", ">= 6.0", "< 6.1"
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -1,5 +1,5 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
3
 
4
4
  platform :ruby do
5
5
  gem "sqlite3"
@@ -7,4 +7,4 @@ end
7
7
 
8
8
  platform :jruby do
9
9
  gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
- end
10
+ end
@@ -0,0 +1,4 @@
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
3
+
4
+ gem "activerecord", ">= 6.1", "< 6.2"
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "sqlite3"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
+ end
@@ -0,0 +1,4 @@
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
3
+
4
+ gem "activerecord", ">= 7.0", "< 7.1"
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "sqlite3"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
+ end
data/init.rb CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'schema_validations' unless defined?(SchemaValidations)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SchemaValidations
2
4
  module ActiveRecord
3
5
  module Type
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SchemaValidations
2
4
  module ActiveRecord
3
5
  module Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SchemaValidations
2
4
  class Railtie < Rails::Railtie #:nodoc:
3
5
 
@@ -1,11 +1,19 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SchemaValidations
2
4
  module Validators
3
5
  # Validates that the field is not nil?
4
6
  # (Unlike the standard PresenceValidator which uses #blank?)
5
7
  class NotNilValidator < ActiveModel::EachValidator
6
- def validate_each(record, attr_name, value)
7
- record.errors.add(attr_name, :blank, options) if value.nil?
8
+ if Gem::Version.new(::ActiveRecord::VERSION::STRING) < Gem::Version.new('6.1')
9
+ def validate_each(record, attr_name, value)
10
+ record.errors.add(attr_name, :blank, options) if value.nil?
11
+ end
12
+ else
13
+ def validate_each(record, attr_name, value)
14
+ record.errors.add(attr_name, :blank, **options) if value.nil?
15
+ end
8
16
  end
9
17
  end
10
18
  end
11
- end
19
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SchemaValidations
2
- VERSION = "2.2.1"
4
+ VERSION = "2.4.1"
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'valuable'
2
4
 
3
5
  require 'schema_plus_columns'
data/schema_dev.yml CHANGED
@@ -1,8 +1,13 @@
1
1
  ruby:
2
- - 2.3.1
2
+ - 2.5
3
+ - 2.7
4
+ - 3.0
5
+ - 3.1
3
6
  activerecord:
4
- - 4.2
5
- - 5.0
7
+ - 5.2
8
+ - 6.0
9
+ - 6.1
10
+ - 7.0
6
11
  db:
7
12
  - mysql2
8
13
  - postgresql
@@ -1,35 +1,31 @@
1
- # -*- encoding: utf-8 -*-
1
+ # frozen_string_literal: true
2
+
2
3
  $:.push File.expand_path("../lib", __FILE__)
3
4
  require "schema_validations/version"
4
5
 
5
- Gem::Specification.new do |s|
6
- s.name = "schema_validations"
7
- s.version = SchemaValidations::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = ["Ronen Barzel", "Michał Łomnicki"]
10
- s.email = ["ronen@barzel.org", "michal.lomnicki@gmail.com"]
11
- s.homepage = "https://github.com/SchemaPlus/schema_validations"
12
- s.summary = "Automatically creates validations basing on the database schema."
13
- s.description = "SchemaValidations extends ActiveRecord to automatically create validations by inspecting the database schema. This makes your models more DRY as you no longer need to duplicate NOT NULL, unique, numeric and varchar constraints on the model level."
14
- s.license = 'MIT'
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "schema_validations"
8
+ gem.version = SchemaValidations::VERSION
9
+ gem.platform = Gem::Platform::RUBY
10
+ gem.authors = ["Ronen Barzel", "Michał Łomnicki"]
11
+ gem.email = ["ronen@barzel.org", "michal.lomnicki@gmail.com"]
12
+ gem.homepage = "https://github.com/SchemaPlus/schema_validations"
13
+ gem.summary = "Automatically creates validations basing on the database schema."
14
+ gem.description = "SchemaValidations extends ActiveRecord to automatically create validations by inspecting the database schema. This makes your models more DRY as you no longer need to duplicate NOT NULL, unique, numeric and varchar constraints on the model level."
15
+ gem.license = 'MIT'
15
16
 
16
- s.rubyforge_project = "schema_validations"
17
+ gem.files = `git ls-files`.split("\n")
18
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ gem.require_paths = ["lib"]
17
21
 
18
- s.files = `git ls-files`.split("\n")
19
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
- s.require_paths = ["lib"]
22
+ gem.required_ruby_version = '>= 2.5'
22
23
 
23
- s.add_dependency("schema_plus_columns")
24
- s.add_dependency("activerecord", ">= 4.2.1", "< 5.1")
25
- s.add_dependency("valuable")
24
+ gem.add_dependency 'schema_plus_columns', '~> 1.0.1'
25
+ gem.add_dependency 'activerecord', '>= 5.2', '< 7.1'
26
+ gem.add_dependency 'valuable'
26
27
 
27
- s.add_development_dependency("schema_dev", "~> 3.6")
28
- s.add_development_dependency("rake")
29
- s.add_development_dependency("rdoc")
30
- s.add_development_dependency("rspec")
31
- s.add_development_dependency("simplecov")
32
- s.add_development_dependency("simplecov-gem-profile")
33
- s.add_development_dependency("database_cleaner")
28
+ gem.add_development_dependency 'rake', '~> 13.0'
29
+ gem.add_development_dependency 'rspec', '~> 3.0'
30
+ gem.add_development_dependency 'schema_dev', '~> 4.2.0'
34
31
  end
35
-
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'simplecov'
2
- require 'simplecov-gem-profile'
3
- SimpleCov.start "gem"
4
+ SimpleCov.start unless SimpleCov.running
4
5
 
5
6
  $LOAD_PATH.unshift(File.dirname(__FILE__))
6
7
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
@@ -9,26 +10,17 @@ require 'rspec'
9
10
  require 'active_record'
10
11
  require 'schema_validations'
11
12
  require 'schema_dev/rspec'
12
- require 'database_cleaner'
13
- DatabaseCleaner.strategy = :truncation
14
13
 
15
14
  SchemaDev::Rspec.setup
16
15
 
17
16
  RSpec.configure do |config|
18
17
  config.around(:each) do |example|
19
- DatabaseCleaner.clean
20
- remove_all_models
21
-
22
- class ActiveRecord::InternalMetadata
23
- def self.create_table
24
- end
25
-
26
- def self.[]=(first, second)
27
- end
28
- end
29
-
30
18
  ActiveRecord::Migration.suppress_messages do
31
19
  example.run
20
+ ensure
21
+ ActiveRecord::Base.connection.tables.each do |table|
22
+ ActiveRecord::Migration.drop_table table, force: :cascade
23
+ end
32
24
  end
33
25
  end
34
26
  end
@@ -36,14 +28,16 @@ end
36
28
  # avoid deprecation warnings
37
29
  I18n.enforce_available_locales = true
38
30
 
39
- Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
31
+ Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each { |f| require f }
40
32
 
41
- def remove_all_models
42
- ObjectSpace.each_object(Class) do |c|
43
- next unless c.ancestors.include? ActiveRecord::Base
44
- next if c == ActiveRecord::Base
45
- next if c.name.blank?
46
- ActiveSupport::Dependencies.remove_constant c.name
33
+ def define_schema(config={}, &block)
34
+ ActiveRecord::Migration.suppress_messages do
35
+ ActiveRecord::Schema.define do
36
+ connection.tables.each do |table|
37
+ drop_table table, force: :cascade
38
+ end
39
+ instance_eval &block
40
+ end
47
41
  end
48
42
  end
49
43
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # ported from rspec-rails
2
4
  # There is no reason to install whole gem as we
3
5
  # need only that tiny helper
@@ -1,9 +1,20 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
4
 
3
5
  describe "Validations" do
6
+ def stub_model(name, base = ActiveRecord::Base, &block)
7
+ klass = Class.new(base)
8
+
9
+ if block_given?
10
+ klass.instance_eval(&block)
11
+ end
12
+
13
+ stub_const(name, klass)
14
+ end
4
15
 
5
16
  before(:each) do
6
- ActiveRecord::Schema.define do
17
+ define_schema do
7
18
 
8
19
  create_table :articles, force: true do |t|
9
20
  t.string :title, limit: 50
@@ -39,15 +50,15 @@ describe "Validations" do
39
50
  context "auto-created" do
40
51
  before(:each) do
41
52
  with_auto_validations do
42
- class Article < ActiveRecord::Base ; end
53
+ stub_model('Article')
43
54
 
44
- class Review < ActiveRecord::Base
55
+ stub_model('Review') do
45
56
  belongs_to :article
46
57
  belongs_to :news_article, class_name: 'Article', foreign_key: :article_id
47
58
  schema_validations except: :content
48
59
  end
49
60
 
50
- class ArticleReview < ActiveRecord::Base
61
+ stub_model('ArticleReview') do
51
62
  belongs_to :article
52
63
  belongs_to :review
53
64
  end
@@ -185,7 +196,7 @@ describe "Validations" do
185
196
  end
186
197
  end
187
198
  with_auto_validations do
188
- class AntiNull < ActiveRecord::Base
199
+ stub_model('AntiNull') do
189
200
  def self.all_blank
190
201
  @all_blank ||= AntiNull.new(
191
202
  no_default: '',
@@ -242,8 +253,8 @@ describe "Validations" do
242
253
  context "auto-created but changed" do
243
254
  before(:each) do
244
255
  with_auto_validations do
245
- class Article < ActiveRecord::Base ; end
246
- class Review < ActiveRecord::Base
256
+ stub_model('Article')
257
+ stub_model('Review') do
247
258
  belongs_to :article
248
259
  belongs_to :news_article, class_name: 'Article', foreign_key: :article_id
249
260
  end
@@ -312,7 +323,8 @@ describe "Validations" do
312
323
  end
313
324
 
314
325
  before(:each) do
315
- class Review < ActiveRecord::Base
326
+ stub_model('Article')
327
+ stub_model('Review') do
316
328
  belongs_to :article
317
329
  belongs_to :news_article, class_name: 'Article', foreign_key: :article_id
318
330
  end
@@ -337,10 +349,10 @@ describe "Validations" do
337
349
 
338
350
  context "manually invoked" do
339
351
  before(:each) do
340
- class Article < ActiveRecord::Base ; end
352
+ stub_model('Article')
341
353
  Article.schema_validations only: [:title, :state]
342
354
 
343
- class Review < ActiveRecord::Base
355
+ stub_model('Review') do
344
356
  belongs_to :dummy_association
345
357
  schema_validations except: :content
346
358
  end
@@ -376,7 +388,7 @@ describe "Validations" do
376
388
 
377
389
  context "manually invoked" do
378
390
  before(:each) do
379
- class Review < ActiveRecord::Base
391
+ stub_model('Review') do
380
392
  belongs_to :article
381
393
  end
382
394
  @columns = Review.content_columns.dup
@@ -397,16 +409,16 @@ describe "Validations" do
397
409
  around(:each) { |example| with_auto_validations(&example) }
398
410
 
399
411
  it "should set validations on base class" do
400
- class Review < ActiveRecord::Base ; end
401
- class PremiumReview < Review ; end
412
+ stub_model('Review')
413
+ stub_model('PremiumReview', Review)
402
414
  PremiumReview.new
403
415
  expect(Review.new.error_on(:author).size).to eq(1)
404
416
  end
405
417
 
406
418
  it "shouldn't create doubled validations" do
407
- class Review < ActiveRecord::Base ; end
419
+ stub_model('Review')
408
420
  Review.new
409
- class PremiumReview < Review ; end
421
+ stub_model('PremiumReview', Review)
410
422
  expect(PremiumReview.new.error_on(:author).size).to eq(1)
411
423
  end
412
424
 
@@ -414,7 +426,7 @@ describe "Validations" do
414
426
 
415
427
  context "when used with enum" do
416
428
  it "does not validate numericality" do
417
- class Article < ActiveRecord::Base
429
+ stub_model('Article') do
418
430
  enum state: [:happy, :sad]
419
431
  end
420
432
  expect(Article.new(valid_article_attributes.merge(state: :happy))).to be_valid
@@ -437,7 +449,7 @@ describe "Validations" do
437
449
  end
438
450
 
439
451
  with_auto_validations do
440
- class Book < ActiveRecord::Base; end
452
+ stub_model('Book') do; end
441
453
  end
442
454
  end
443
455
 
@@ -462,8 +474,8 @@ describe "Validations" do
462
474
  end
463
475
 
464
476
  with_auto_validations do
465
- class Folder < ActiveRecord::Base
466
- belongs_to :parent, class_name: Folder.name
477
+ stub_model('Folder') do
478
+ belongs_to :parent, class_name: 'Folder'
467
479
  end
468
480
  end
469
481
  end
@@ -487,7 +499,7 @@ describe "Validations" do
487
499
  end
488
500
  end
489
501
  with_auto_validations do
490
- class Optimistic < ActiveRecord::Base; end
502
+ stub_model('Optimistic') do; end
491
503
  end
492
504
  end
493
505
  it 'should not crash' do
metadata CHANGED
@@ -1,50 +1,50 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ronen Barzel
8
8
  - Michał Łomnicki
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-08 00:00:00.000000000 Z
12
+ date: 2022-06-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: schema_plus_columns
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: 1.0.1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '0'
27
+ version: 1.0.1
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: activerecord
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 4.2.1
34
+ version: '5.2'
35
35
  - - "<"
36
36
  - !ruby/object:Gem::Version
37
- version: '5.1'
37
+ version: '7.1'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- version: 4.2.1
44
+ version: '5.2'
45
45
  - - "<"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.1'
47
+ version: '7.1'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: valuable
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -60,103 +60,47 @@ dependencies:
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  - !ruby/object:Gem::Dependency
63
- name: schema_dev
63
+ name: rake
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.6'
68
+ version: '13.0'
69
69
  type: :development
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.6'
76
- - !ruby/object:Gem::Dependency
77
- name: rake
78
- requirement: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- type: :development
84
- prerelease: false
85
- version_requirements: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- - !ruby/object:Gem::Dependency
91
- name: rdoc
92
- requirement: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- type: :development
98
- prerelease: false
99
- version_requirements: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
75
+ version: '13.0'
104
76
  - !ruby/object:Gem::Dependency
105
77
  name: rspec
106
78
  requirement: !ruby/object:Gem::Requirement
107
79
  requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- type: :development
112
- prerelease: false
113
- version_requirements: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- - !ruby/object:Gem::Dependency
119
- name: simplecov
120
- requirement: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- type: :development
126
- prerelease: false
127
- version_requirements: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- - !ruby/object:Gem::Dependency
133
- name: simplecov-gem-profile
134
- requirement: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
80
+ - - "~>"
137
81
  - !ruby/object:Gem::Version
138
- version: '0'
82
+ version: '3.0'
139
83
  type: :development
140
84
  prerelease: false
141
85
  version_requirements: !ruby/object:Gem::Requirement
142
86
  requirements:
143
- - - ">="
87
+ - - "~>"
144
88
  - !ruby/object:Gem::Version
145
- version: '0'
89
+ version: '3.0'
146
90
  - !ruby/object:Gem::Dependency
147
- name: database_cleaner
91
+ name: schema_dev
148
92
  requirement: !ruby/object:Gem::Requirement
149
93
  requirements:
150
- - - ">="
94
+ - - "~>"
151
95
  - !ruby/object:Gem::Version
152
- version: '0'
96
+ version: 4.2.0
153
97
  type: :development
154
98
  prerelease: false
155
99
  version_requirements: !ruby/object:Gem::Requirement
156
100
  requirements:
157
- - - ">="
101
+ - - "~>"
158
102
  - !ruby/object:Gem::Version
159
- version: '0'
103
+ version: 4.2.0
160
104
  description: SchemaValidations extends ActiveRecord to automatically create validations
161
105
  by inspecting the database schema. This makes your models more DRY as you no longer
162
106
  need to duplicate NOT NULL, unique, numeric and varchar constraints on the model
@@ -168,21 +112,30 @@ executables: []
168
112
  extensions: []
169
113
  extra_rdoc_files: []
170
114
  files:
115
+ - ".github/workflows/prs.yml"
171
116
  - ".gitignore"
172
- - ".travis.yml"
117
+ - ".simplecov"
173
118
  - Gemfile
174
119
  - MIT-LICENSE
175
120
  - README.md
176
121
  - Rakefile
177
122
  - gemfiles/Gemfile.base
178
- - gemfiles/activerecord-4.2/Gemfile.base
179
- - gemfiles/activerecord-4.2/Gemfile.mysql2
180
- - gemfiles/activerecord-4.2/Gemfile.postgresql
181
- - gemfiles/activerecord-4.2/Gemfile.sqlite3
182
- - gemfiles/activerecord-5.0/Gemfile.base
183
- - gemfiles/activerecord-5.0/Gemfile.mysql2
184
- - gemfiles/activerecord-5.0/Gemfile.postgresql
185
- - gemfiles/activerecord-5.0/Gemfile.sqlite3
123
+ - gemfiles/activerecord-5.2/Gemfile.base
124
+ - gemfiles/activerecord-5.2/Gemfile.mysql2
125
+ - gemfiles/activerecord-5.2/Gemfile.postgresql
126
+ - gemfiles/activerecord-5.2/Gemfile.sqlite3
127
+ - gemfiles/activerecord-6.0/Gemfile.base
128
+ - gemfiles/activerecord-6.0/Gemfile.mysql2
129
+ - gemfiles/activerecord-6.0/Gemfile.postgresql
130
+ - gemfiles/activerecord-6.0/Gemfile.sqlite3
131
+ - gemfiles/activerecord-6.1/Gemfile.base
132
+ - gemfiles/activerecord-6.1/Gemfile.mysql2
133
+ - gemfiles/activerecord-6.1/Gemfile.postgresql
134
+ - gemfiles/activerecord-6.1/Gemfile.sqlite3
135
+ - gemfiles/activerecord-7.0/Gemfile.base
136
+ - gemfiles/activerecord-7.0/Gemfile.mysql2
137
+ - gemfiles/activerecord-7.0/Gemfile.postgresql
138
+ - gemfiles/activerecord-7.0/Gemfile.sqlite3
186
139
  - init.rb
187
140
  - lib/schema_validations.rb
188
141
  - lib/schema_validations/active_record/type.rb
@@ -192,7 +145,6 @@ files:
192
145
  - lib/schema_validations/version.rb
193
146
  - schema_dev.yml
194
147
  - schema_validations.gemspec
195
- - spec/schema_validations.sqlite3
196
148
  - spec/spec_helper.rb
197
149
  - spec/support/active_model.rb
198
150
  - spec/validations_spec.rb
@@ -200,7 +152,7 @@ homepage: https://github.com/SchemaPlus/schema_validations
200
152
  licenses:
201
153
  - MIT
202
154
  metadata: {}
203
- post_install_message:
155
+ post_install_message:
204
156
  rdoc_options: []
205
157
  require_paths:
206
158
  - lib
@@ -208,20 +160,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
208
160
  requirements:
209
161
  - - ">="
210
162
  - !ruby/object:Gem::Version
211
- version: '0'
163
+ version: '2.5'
212
164
  required_rubygems_version: !ruby/object:Gem::Requirement
213
165
  requirements:
214
166
  - - ">="
215
167
  - !ruby/object:Gem::Version
216
168
  version: '0'
217
169
  requirements: []
218
- rubyforge_project: schema_validations
219
- rubygems_version: 2.5.1
220
- signing_key:
170
+ rubygems_version: 3.1.6
171
+ signing_key:
221
172
  specification_version: 4
222
173
  summary: Automatically creates validations basing on the database schema.
223
174
  test_files:
224
- - spec/schema_validations.sqlite3
225
175
  - spec/spec_helper.rb
226
176
  - spec/support/active_model.rb
227
177
  - spec/validations_spec.rb
data/.travis.yml DELETED
@@ -1,21 +0,0 @@
1
- # This file was auto-generated by the schema_dev tool, based on the data in
2
- # ./schema_dev.yml
3
- # Please do not edit this file; any changes will be overwritten next time
4
- # schema_dev gets run.
5
- ---
6
- sudo: false
7
- rvm:
8
- - 2.3.1
9
- gemfile:
10
- - gemfiles/activerecord-4.2/Gemfile.mysql2
11
- - gemfiles/activerecord-4.2/Gemfile.postgresql
12
- - gemfiles/activerecord-4.2/Gemfile.sqlite3
13
- - gemfiles/activerecord-5.0/Gemfile.mysql2
14
- - gemfiles/activerecord-5.0/Gemfile.postgresql
15
- - gemfiles/activerecord-5.0/Gemfile.sqlite3
16
- env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
17
- addons:
18
- postgresql: '9.4'
19
- before_script: bundle exec rake create_databases
20
- after_script: bundle exec rake drop_databases
21
- script: bundle exec rake travis
@@ -1,3 +0,0 @@
1
- eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
-
3
- gem "activerecord", "~> 4.2.6"
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "mysql2", '>= 0.3.18', '< 0.5'
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcmysql-adapter'
10
- end
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "pg"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcpostgresql-adapter'
10
- end
@@ -1,3 +0,0 @@
1
- eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
-
3
- gem "activerecord", "~> 5.0.1"
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "mysql2"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcmysql-adapter'
10
- end
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "pg"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcpostgresql-adapter'
10
- end
Binary file