legacy_data 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/generators/models_from_tables/templates/model.rb +4 -2
- data/legacy_data.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
@@ -22,7 +22,7 @@ class <%= class_name -%> < ActiveRecord::Base
|
|
22
22
|
<%- end -%>
|
23
23
|
<%= "validates_presence_of #{constraints[:presence_of].map {|cols| cols.downcase.to_sym.inspect}.join(', ')}" unless constraints[:presence_of].blank? %>
|
24
24
|
<%- constraints[:boolean_presence].each do |col|
|
25
|
-
-%> validates_inclusion_of <%= col %>, :in => %w(true false)
|
25
|
+
-%> validates_inclusion_of <%= col.to_sym.inspect %>, :in => %w(true false)
|
26
26
|
<%- end -%>
|
27
27
|
<%- [:allow_nil, :do_not_allow_nil].each do |nullable|
|
28
28
|
unless constraints[:numericality_of][nullable].blank?
|
@@ -33,7 +33,9 @@ class <%= class_name -%> < ActiveRecord::Base
|
|
33
33
|
-%> validate <%= "validate_#{name}".to_sym.inspect %>
|
34
34
|
def <%= "validate_#{name}" %>
|
35
35
|
# TODO: validate this SQL constraint
|
36
|
-
|
36
|
+
<<-SQL
|
37
|
+
<%= sql_rule %>
|
38
|
+
SQL
|
37
39
|
end
|
38
40
|
<%- end -%>
|
39
41
|
end
|
data/legacy_data.gemspec
CHANGED