Lesson 5

Íàïðèìåð ÿ õî÷ó çàïîìíèòü äíè ðîæäåíèÿ äðóçåé. Îðèãèíàë - èìÿ, ïåðåâîä - äàòà.


> On 21 äåê. 2014 ã., at 13:50, mfoxtrot <notifications@github.com> wrote:
> 
> In app/models/card.rb:
> 
> > @@ -1,6 +1,10 @@
> >  class Card < ActiveRecord::Base
> >    validates :original_text, :translated_text, presence: true
> >    validate :original_not_equal_translation
> > +  validates_length_of :original_text, minimum: 1
> > +  validates_length_of :translated_text, minimum: 1
> > +  validates_format_of :original_text, with: /[ a-zA-Zà-ÿÀ-ß\s]/, message: "Îðèãèíàë íå ñîäåðæèò íè îäíîé áóêâû!"
> > +  validates_format_of :translated_text, with: /[ a-zA-Zà-ÿÀ-ß\s]/, message: "Ïåðåâîä íå ñîäåðæèò íè îäíîé áóêâû!"
> Ïî÷åìó òû ñ÷èòàåøü, ÷òî â òàêîé âàëèäàöèè íåò íåîáõîäèìîñòè? Þçåð âåäü ìîæåò ââåñòè, íàïðèìåð, íàáîð öèôð.
> 
> —
> Reply to this email directly or view it on GitHub.
>