pgmodelgen 0.4.9 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tasks/pgmodelgen.rake +3 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ad425f858c9fd2d8c883383358c0a446d775577
4
- data.tar.gz: 0bd3fa46555b60481a4aa4258ee2f00e4c018235
3
+ metadata.gz: dec638f4b234de33c42f779137decc38d8d02ee0
4
+ data.tar.gz: 112bf752c2de8b1d795eac897e0f998dec8f9dec
5
5
  SHA512:
6
- metadata.gz: 4816bf1f58fff79b1effbdb4f6c8b6d4b261e22442c10ad0a29ca55cf333318207a0647109951076fdc5874b89299716c9e9b656bcdde0c5f3f39a848190eb95
7
- data.tar.gz: 6fd96046ff34ca0a4f7adbee76e9a913bae0d7cce02e2922abe69236f56ac5ffabe897a134f1da35509aadcd16e7b5d60e4ab11c405f7c21cad4414594d310ae
6
+ metadata.gz: eacb21d500cf071396bc3c0f5eb99b0bd55f045bd33d8959232de001ea3b3b808a1007cb9d57267c0cbab8dbf7fc40ebc85c970a1ed7e4c4d556f2f8a05511e1
7
+ data.tar.gz: 406008525e085ba3b6448099cf116edfd4d433737061d50cf0ef33d00135620d56144e11271d7fa875c089b36577c2d018dc06bc11117a94306ec45abe91ca75
@@ -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 => /#{match[1].gsub('\\\\.','').gsub('/','\/')}/i#{allow_nil}\n"
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.9
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-06 00:00:00.000000000 Z
11
+ date: 2013-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler