Submit Search
Upload
TDC2016SP - Rails Custom Validators - Não se esqueça deles
•
1 like
•
294 views
tdc-globalcode
Follow
Rails Custom Validators - Não se esqueça deles
Read less
Read more
Education
Report
Share
Report
Share
1 of 28
Download now
Download to read offline
Recommended
Drupal sins 2016 10-06
Drupal sins 2016 10-06
Aaron Crosman
Sins Against Drupal 2
Sins Against Drupal 2
Aaron Crosman
webstudy jquery
webstudy jquery
Seungho Han
PhoneGap: Local Storage
PhoneGap: Local Storage
Ivano Malavolta
Javascript application
Javascript application
Martin Sendra
14001 Certificate_Md. Sajjad Hossain Sajib
14001 Certificate_Md. Sajjad Hossain Sajib
Sajjad Sajib
Cinco características para franquiciar una empresa.
Cinco características para franquiciar una empresa.
bomboclank
Mwr twr white-paper
Mwr twr white-paper
Adarsh Sinha
Recommended
Drupal sins 2016 10-06
Drupal sins 2016 10-06
Aaron Crosman
Sins Against Drupal 2
Sins Against Drupal 2
Aaron Crosman
webstudy jquery
webstudy jquery
Seungho Han
PhoneGap: Local Storage
PhoneGap: Local Storage
Ivano Malavolta
Javascript application
Javascript application
Martin Sendra
14001 Certificate_Md. Sajjad Hossain Sajib
14001 Certificate_Md. Sajjad Hossain Sajib
Sajjad Sajib
Cinco características para franquiciar una empresa.
Cinco características para franquiciar una empresa.
bomboclank
Mwr twr white-paper
Mwr twr white-paper
Adarsh Sinha
Jharkhand Staff Selection Commission notification 2015
Jharkhand Staff Selection Commission notification 2015
Raja Kashyap
Estructura de un computador
Estructura de un computador
ArroyoEric
MAS Decadence Presentation
MAS Decadence Presentation
latymermedia
Libro blanco de las tic capitulo 1 y 2
Libro blanco de las tic capitulo 1 y 2
Universidad del QuindÍo
Algoritmo selectivo
Algoritmo selectivo
salerogustavo
Getting started with ES6
Getting started with ES6
Nitay Neeman
What is New in HTML5?
What is New in HTML5?
Nitay Neeman
Capitulo 3 y 4 del libro blanco de las tic
Capitulo 3 y 4 del libro blanco de las tic
Universidad del QuindÍo
Пан Коцький
Пан Коцький
Osya Dubyaga
4 ficha refuerzo 1º eso
4 ficha refuerzo 1º eso
Lolicanadilla
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
tdc-globalcode
Blogs Empresariales T2
Blogs Empresariales T2
Consultores Valencia
Ansoff matrix
Ansoff matrix
Vikram Gangal
McCulley_FinalPaperAlexander
McCulley_FinalPaperAlexander
Brent McCulley
Sistema de franquicias
Sistema de franquicias
Iris Mabel Barrios Bustamante
Form demoinplaywithmysql
Form demoinplaywithmysql
Knoldus Inc.
OpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con Python
PyCon Italia
Miniproject on Employee Management using Perl/Database.
Miniproject on Employee Management using Perl/Database.
Sanchit Raut
Shangz R Brown Presentation
Shangz R Brown Presentation
shangbaby
Desenvolvimento web com Ruby on Rails (parte 5)
Desenvolvimento web com Ruby on Rails (parte 5)
Joao Lucas Santana
Practical PHP by example Jan Leth-Kjaer
Practical PHP by example Jan Leth-Kjaer
COMMON Europe
RubyBarCamp “Полезные gems и plugins”
RubyBarCamp “Полезные gems и plugins”
apostlion
More Related Content
Viewers also liked
Jharkhand Staff Selection Commission notification 2015
Jharkhand Staff Selection Commission notification 2015
Raja Kashyap
Estructura de un computador
Estructura de un computador
ArroyoEric
MAS Decadence Presentation
MAS Decadence Presentation
latymermedia
Libro blanco de las tic capitulo 1 y 2
Libro blanco de las tic capitulo 1 y 2
Universidad del QuindÍo
Algoritmo selectivo
Algoritmo selectivo
salerogustavo
Getting started with ES6
Getting started with ES6
Nitay Neeman
What is New in HTML5?
What is New in HTML5?
Nitay Neeman
Capitulo 3 y 4 del libro blanco de las tic
Capitulo 3 y 4 del libro blanco de las tic
Universidad del QuindÍo
Пан Коцький
Пан Коцький
Osya Dubyaga
4 ficha refuerzo 1º eso
4 ficha refuerzo 1º eso
Lolicanadilla
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
tdc-globalcode
Blogs Empresariales T2
Blogs Empresariales T2
Consultores Valencia
Ansoff matrix
Ansoff matrix
Vikram Gangal
McCulley_FinalPaperAlexander
McCulley_FinalPaperAlexander
Brent McCulley
Sistema de franquicias
Sistema de franquicias
Iris Mabel Barrios Bustamante
Viewers also liked
(15)
Jharkhand Staff Selection Commission notification 2015
Jharkhand Staff Selection Commission notification 2015
Estructura de un computador
Estructura de un computador
MAS Decadence Presentation
MAS Decadence Presentation
Libro blanco de las tic capitulo 1 y 2
Libro blanco de las tic capitulo 1 y 2
Algoritmo selectivo
Algoritmo selectivo
Getting started with ES6
Getting started with ES6
What is New in HTML5?
What is New in HTML5?
Capitulo 3 y 4 del libro blanco de las tic
Capitulo 3 y 4 del libro blanco de las tic
Пан Коцький
Пан Коцький
4 ficha refuerzo 1º eso
4 ficha refuerzo 1º eso
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
Blogs Empresariales T2
Blogs Empresariales T2
Ansoff matrix
Ansoff matrix
McCulley_FinalPaperAlexander
McCulley_FinalPaperAlexander
Sistema de franquicias
Sistema de franquicias
Similar to TDC2016SP - Rails Custom Validators - Não se esqueça deles
Form demoinplaywithmysql
Form demoinplaywithmysql
Knoldus Inc.
OpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con Python
PyCon Italia
Miniproject on Employee Management using Perl/Database.
Miniproject on Employee Management using Perl/Database.
Sanchit Raut
Shangz R Brown Presentation
Shangz R Brown Presentation
shangbaby
Desenvolvimento web com Ruby on Rails (parte 5)
Desenvolvimento web com Ruby on Rails (parte 5)
Joao Lucas Santana
Practical PHP by example Jan Leth-Kjaer
Practical PHP by example Jan Leth-Kjaer
COMMON Europe
RubyBarCamp “Полезные gems и plugins”
RubyBarCamp “Полезные gems и plugins”
apostlion
Desenvolvimento web com Ruby on Rails (extras)
Desenvolvimento web com Ruby on Rails (extras)
Joao Lucas Santana
Polymer - pleasant client-side programming with web components
Polymer - pleasant client-side programming with web components
psstoev
Rails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power Stack
David Copeland
GHC Participant Training
GHC Participant Training
AidIQ
Bag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
Marcus Ramberg
Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2
Christoffer Noring
Desenvolvimento web com Ruby on Rails (parte 3)
Desenvolvimento web com Ruby on Rails (parte 3)
Joao Lucas Santana
Contacto server API in PHP
Contacto server API in PHP
Hem Shrestha
Intro to Ember.JS 2016
Intro to Ember.JS 2016
Sandino Núñez
Borrador del blog
Borrador del blog
Sena Cedagro
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
pauldix
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
pauldix
vue-reactivity.pdf
vue-reactivity.pdf
NuttavutThongjor1
Similar to TDC2016SP - Rails Custom Validators - Não se esqueça deles
(20)
Form demoinplaywithmysql
Form demoinplaywithmysql
OpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con Python
Miniproject on Employee Management using Perl/Database.
Miniproject on Employee Management using Perl/Database.
Shangz R Brown Presentation
Shangz R Brown Presentation
Desenvolvimento web com Ruby on Rails (parte 5)
Desenvolvimento web com Ruby on Rails (parte 5)
Practical PHP by example Jan Leth-Kjaer
Practical PHP by example Jan Leth-Kjaer
RubyBarCamp “Полезные gems и plugins”
RubyBarCamp “Полезные gems и plugins”
Desenvolvimento web com Ruby on Rails (extras)
Desenvolvimento web com Ruby on Rails (extras)
Polymer - pleasant client-side programming with web components
Polymer - pleasant client-side programming with web components
Rails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power Stack
GHC Participant Training
GHC Participant Training
Bag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2
Desenvolvimento web com Ruby on Rails (parte 3)
Desenvolvimento web com Ruby on Rails (parte 3)
Contacto server API in PHP
Contacto server API in PHP
Intro to Ember.JS 2016
Intro to Ember.JS 2016
Borrador del blog
Borrador del blog
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
vue-reactivity.pdf
vue-reactivity.pdf
More from tdc-globalcode
TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
tdc-globalcode
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
tdc-globalcode
TDC2019 Intel Software Day - ACATE - Cases de Sucesso
TDC2019 Intel Software Day - ACATE - Cases de Sucesso
tdc-globalcode
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
tdc-globalcode
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
tdc-globalcode
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
tdc-globalcode
TDC2019 Intel Software Day - Inferencia de IA em edge devices
TDC2019 Intel Software Day - Inferencia de IA em edge devices
tdc-globalcode
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
tdc-globalcode
Trilha .Net - Programacao funcional usando f#
Trilha .Net - Programacao funcional usando f#
tdc-globalcode
TDC2018SP | Trilha Go - Case Easylocus
TDC2018SP | Trilha Go - Case Easylocus
tdc-globalcode
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
tdc-globalcode
TDC2018SP | Trilha Go - Clean architecture em Golang
TDC2018SP | Trilha Go - Clean architecture em Golang
tdc-globalcode
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
tdc-globalcode
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
tdc-globalcode
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
tdc-globalcode
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
tdc-globalcode
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
tdc-globalcode
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
tdc-globalcode
TDC2018SP | Trilha .Net - .NET funcional com F#
TDC2018SP | Trilha .Net - .NET funcional com F#
tdc-globalcode
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor em .Net Core
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor em .Net Core
tdc-globalcode
More from tdc-globalcode
(20)
TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
TDC2019 Intel Software Day - ACATE - Cases de Sucesso
TDC2019 Intel Software Day - ACATE - Cases de Sucesso
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
TDC2019 Intel Software Day - Inferencia de IA em edge devices
TDC2019 Intel Software Day - Inferencia de IA em edge devices
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
Trilha .Net - Programacao funcional usando f#
Trilha .Net - Programacao funcional usando f#
TDC2018SP | Trilha Go - Case Easylocus
TDC2018SP | Trilha Go - Case Easylocus
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
TDC2018SP | Trilha Go - Clean architecture em Golang
TDC2018SP | Trilha Go - Clean architecture em Golang
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
TDC2018SP | Trilha .Net - .NET funcional com F#
TDC2018SP | Trilha .Net - .NET funcional com F#
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor em .Net Core
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor em .Net Core
Recently uploaded
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
Chameera Dedduwage
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
Marc Dusseiller Dusjagr
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Sapana Sha
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
akmcokerachita
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
AnaBeatriceAblay2
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
sanyamsingh5019
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
AvyJaneVismanos
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
Sarwono Sutikno, Dr.Eng.,CISA,CISSP,CISM,CSX-F
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
iammrhaywood
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
Virag Sontakke
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
manuelaromero2013
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
SafetyChain Software
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Celine George
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
UnboundStockton
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
JhengPantaleon
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
KarinaGenton
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
VS Mahajan Coaching Centre
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
Celine George
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
GeoBlogs
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
eniolaolutunde
Recently uploaded
(20)
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
TDC2016SP - Rails Custom Validators - Não se esqueça deles
1.
RAILS CUSTOM VALIDATORS @marcelinol
2.
DEFAULT VALIDATORS
3.
RAILS GENERATE MODEL
PERSON NAME:STRING EMAIL:STRING PERSONAL_SITE:STRING
4.
# app/models/person.rb
5.
> p =
Person.create(name: 'Nome', personal_site: 'http://pudim.com.br') (0.2ms) begin transaction => (...) (0.1ms) rollback transaction => (...) > p.errors => #<ActiveModel::Errors:0x007fa06fd7c370 @base=#<Person id: nil, name: "Nome", email: nil, personal_site: "http://pudim.com.br", created_at: nil, updated_at: nil>, @messages={:email=>["can't be blank"]}> >
6.
7.
# app/models/person.rb
8.
> p =
Person.create(name: 'Nome', email: 'email@example.org', personal_site: 'xunda') (0.2ms) begin transaction => (...) (0.1ms) rollback transaction => (...) > p.errors => #<ActiveModel::Errors:0x007fa06ff84618 @base=#<Person id: nil, name: "Nome", email: "email@example.org", personal_site: "xunda", created_at: nil, updated_at: nil>, @messages={:personal_site=>["Formato de site inválido"]}> > > p = Person.create(name: 'Nome', email: 'email@example.org', personal_site: 'xunda') (0.2ms) begin transaction => (...) (0.1ms) rollback transaction => (...) > p.errors => #<ActiveModel::Errors:0x007fa06ff84618 @base=#<Person id: nil, name: "Nome", email: "email@example.org", personal_site: "xunda", created_at: nil, updated_at: nil>, @messages={:personal_site=>["Formato de site inválido"]}> >
9.
RAILS GENERATE MODEL
COMPANY NAME:STRING OTHER_PARAMS:XUNDA SITE:STRING
10.
# app/models/company.rb
11.
# app/models/company.rb ISTO NÃO
É DRY
12.
13.
É HORA DE
USAR UM CUSTOM VALIDATOR
14.
# app/validators/url_format_validator.rb
15.
# app/models/person.rb # app/models/company.rb
16.
> p =
Person.create(name: 'Nome', email: 'email@example.org', personal_site: 'xunda') (0.2ms) begin transaction => (...) (0.1ms) rollback transaction => (...) > p.errors => #<ActiveModel::Errors:0x007fa06ff84618 @base=#<Person id: nil, name: "Nome", email: "email@example.org", personal_site: "xunda", created_at: nil, updated_at: nil>, @messages={:personal_site=>["Formato de site inválido"]}> >
17.
# app/models/xunda.rb
18.
if rails.too_old end
19.
VAMOS TESTAR?
20.
21.
CARA, ISSO PODE
FICAR AINDA MAIS BONITO?
22.
23.
SIM
24.
CRIE UM VALIDATION TESTER #
spec/support/validation_tester.rb
25.
26.
# spec/support/validation_tester.rb
27.
SHIPIT.RESULTADOSDIGITAIS.COM.BR PERGUNTAS? CONSIDERAÇÕES? @marcelinol
28.
Obrigado
Download now