activerecord-database_validations 1.0.1 → 1.0.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c958d3e6f6b26b65f447062fc4926cdb73abb06
|
4
|
+
data.tar.gz: 692ec667b6c095d03b6ac8231523be2a8988b6fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 356b01e77794783b83103e9ecc5834f340c28da556426ee3cb1db763cf69208a5800b857c1e0801c1bcddff98d2ec58812bd29feb2961a9bcd19bf34fe5351e1
|
7
|
+
data.tar.gz: f85b060b667b300197ea3d86a466587a45b71cbd6fd6ff2b2af9b1971ea795190f5a04bbe9236151edda8425746998a406520ddb1e3aa4da800c4cbf6db6fcae
|
data/README.md
CHANGED
@@ -129,6 +129,24 @@ show the error on the specific field.
|
|
129
129
|
|
130
130
|
## Development
|
131
131
|
|
132
|
+
To run the tests you must have a user and a database set up in the supported databases.
|
133
|
+
|
134
|
+
As MySQL root:
|
135
|
+
|
136
|
+
```sql
|
137
|
+
CREATE USER 'gemtester'@'localhost';
|
138
|
+
CREATE DATABASE activerecord_database_validations_test;
|
139
|
+
GRANT ALL ON `activerecord_database_validations_test`.* TO 'gemtester'@'localhost';
|
140
|
+
```
|
141
|
+
|
142
|
+
As Postgresql root:
|
143
|
+
|
144
|
+
```sql
|
145
|
+
CREATE USER gemtester;
|
146
|
+
CREATE DATABASE activerecord_database_validations_test;
|
147
|
+
GRANT ALL PRIVILEGES ON DATABASE activerecord_database_validations_test TO gemtester;
|
148
|
+
```
|
149
|
+
|
132
150
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
133
151
|
|
134
152
|
## Contributing
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.summary = %q{Handle database validations}
|
13
13
|
spec.description = %q{Use database validations and convert ActiveRecord::StatementInvalid into ActiveRecord::RecordInvalid}
|
14
14
|
spec.homepage = "https://github.com/odedniv/activerecord-database_validations"
|
15
|
-
spec.license = "
|
15
|
+
spec.license = "Unlicense"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
18
|
spec.bindir = "exe"
|
@@ -56,9 +56,8 @@ module ActiveRecord::DatabaseValidations::Rescues
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
|
60
59
|
FOREIGN_KEY_PATTERNS_BY_COLUMN = [
|
61
|
-
/^Mysql2::Error: Cannot add or update a child row: a foreign key constraint fails \(`.+?`\.`.+?`, CONSTRAINT `.+?` FOREIGN KEY \(`(.+?)`\) REFERENCES `.+?` \(`.+?`\)
|
60
|
+
/^Mysql2::Error: Cannot add or update a child row: a foreign key constraint fails \(`.+?`\.`.+?`, CONSTRAINT `.+?` FOREIGN KEY \(`(.+?)`\) REFERENCES `.+?` \(`.+?`\)(?: ON [A-Z ]+)?\):/,
|
62
61
|
/^PG::ForeignKeyViolation: ERROR: insert or update on table ".+?" violates foreign key constraint ".+?"\nDETAIL: Key \((.+?)\)=\(.+?\) is not present in table ".+?"\.\n:/,
|
63
62
|
]
|
64
63
|
FOREIGN_KEY_PATTERNS_BY_FOREIGN_KEY = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-database_validations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oded Niv
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -167,7 +167,7 @@ files:
|
|
167
167
|
- lib/activerecord/database_validations/version.rb
|
168
168
|
homepage: https://github.com/odedniv/activerecord-database_validations
|
169
169
|
licenses:
|
170
|
-
-
|
170
|
+
- Unlicense
|
171
171
|
metadata: {}
|
172
172
|
post_install_message:
|
173
173
|
rdoc_options: []
|
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
185
|
version: '0'
|
186
186
|
requirements: []
|
187
187
|
rubyforge_project:
|
188
|
-
rubygems_version: 2.
|
188
|
+
rubygems_version: 2.5.1
|
189
189
|
signing_key:
|
190
190
|
specification_version: 4
|
191
191
|
summary: Handle database validations
|