pgmodelgen 0.4.9 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tasks/pgmodelgen.rake +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dec638f4b234de33c42f779137decc38d8d02ee0
|
4
|
+
data.tar.gz: 112bf752c2de8b1d795eac897e0f998dec8f9dec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eacb21d500cf071396bc3c0f5eb99b0bd55f045bd33d8959232de001ea3b3b808a1007cb9d57267c0cbab8dbf7fc40ebc85c970a1ed7e4c4d556f2f8a05511e1
|
7
|
+
data.tar.gz: 406008525e085ba3b6448099cf116edfd4d433737061d50cf0ef33d00135620d56144e11271d7fa875c089b36577c2d018dc06bc11117a94306ec45abe91ca75
|
data/lib/tasks/pgmodelgen.rake
CHANGED
@@ -597,9 +597,11 @@ class PGGen
|
|
597
597
|
|
598
598
|
if row['condition_decleration_src'].match('\)::text ~\* \'(.*)\'::text\)$')
|
599
599
|
|
600
|
+
regex_ruby_style = match[1].gsub('\\\\.','').gsub('/','\/').gsub(/^\^/,"\A").gsub(/\$$/,"\z")
|
601
|
+
|
600
602
|
# Regex check constraint
|
601
603
|
match = row['condition_decleration_src'].match('\)::text ~\* \'(.*)\'::text\)$')
|
602
|
-
models[table_name][:constraint] += "\tvalidates_format_of :#{column_rows.first["attribute_name"]}, :with => /#{
|
604
|
+
models[table_name][:constraint] += "\tvalidates_format_of :#{column_rows.first["attribute_name"]}, :with => /#{regex_ruby_style}/i#{allow_nil}\n, "
|
603
605
|
|
604
606
|
elsif row['condition_decleration_src'].match(/\(char_length\((.*)::text\) >= ([0-9]*)\)/)
|
605
607
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgmodelgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bjorn Blomqvist
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|