pgmodelgen 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tasks/pgmodelgen.rake +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb4be41191539822879579ae93250a5013886577
|
4
|
+
data.tar.gz: 1276ce97601747801a990e69845b879d0cf7cf47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b06ef51aebdc70d06432bbb70d2d36eea17480a88e8ef5ec38887caf18c1f7e98b7a08769e191a46f056b624bb2c6cbd0424333fc7fc60ffcf52bddbc957fea
|
7
|
+
data.tar.gz: 3781de626266a243ef62a0e62e196af4093c6b25624ac40057b4f507d3c58e28a0da803e4ce496753736eaee90901ba6876bcbb0ca732651724e12eaa2819b26
|
data/lib/tasks/pgmodelgen.rake
CHANGED
@@ -599,8 +599,8 @@ class PGGen
|
|
599
599
|
|
600
600
|
# Regex check constraint
|
601
601
|
match = row['condition_decleration_src'].match('\)::text ~\* \'(.*)\'::text\)$')
|
602
|
-
regex_ruby_style = match[1].gsub('\\\\.','').gsub('/','\/').gsub(/^\^/,"
|
603
|
-
models[table_name][:constraint] += "\tvalidates_format_of :#{column_rows.first["attribute_name"]}, :with => /#{regex_ruby_style}/i#{allow_nil}\n
|
602
|
+
regex_ruby_style = match[1].gsub('\\\\.','').gsub('/','\/').gsub(/^\^/,"\\A").gsub(/\$$/,"\\z")
|
603
|
+
models[table_name][:constraint] += "\tvalidates_format_of :#{column_rows.first["attribute_name"]}, :with => /#{regex_ruby_style}/i#{allow_nil}\n"
|
604
604
|
|
605
605
|
elsif row['condition_decleration_src'].match(/\(char_length\((.*)::text\) >= ([0-9]*)\)/)
|
606
606
|
|