lib/cieloz/requisicao_transacao/dados_pedido.rb in cieloz-0.0.8 vs lib/cieloz/requisicao_transacao/dados_pedido.rb in cieloz-0.0.9
- old
+ new
@@ -6,17 +6,17 @@
attr_accessor :numero, :valor, :moeda, :data_hora, :descricao, :idioma, :soft_descriptor
validates :numero, :valor, :moeda, :data_hora, presence: true
- validates :numero, length: { in: 1..20 }
+ validates :numero, length: { maximum: 20 }
- validates :valor, length: { in: 1..12 }
- validates :valor, numericality: { only_integer: true }
+ validates :valor, length: { maximum: 12 }
+ validates :valor, numericality: { only_integer: true }, unless: "@valor.blank?"
- validates :descricao, length: { in: 0..1024 }
+ validates :descricao, length: { maximum: 1024 }
validates :idioma, inclusion: { in: IDIOMAS }
- validates :soft_descriptor, length: { in: 0..13 }
+ validates :soft_descriptor, length: { maximum: 13 }
def attributes
{
numero: @numero,
valor: @valor,