Displaying 1 result from an estimated 1 matches for "code_alpha3".
Did you mean:
code_alpha2
2006 Apr 27
0
DRY validation
...mat :with => /\A[A-Z](?:\s*[''\(-]?[A-Za-z]+[,\.
\)]?)*\z/
a.validates_uniqueness
end
attribute :code_alpha2, :string do |a|
a.validates_length :is => 2
a.validates_format :with => /\A[A-Z]+\z/
a.validates_uniqueness
end
attribute :code_alpha3, :string do |a|
a.validates_length :is => 3
a.validates_format :with => /\A[A-Z]+\z/
a.validates_uniqueness
end
attribute :phone_code, :integer, :allow_nil => true do |a|
a.validates_numericality :greater_than_or_equal_to =>
1, :less_than_or_equa...