[Machinist 2] Unique attributes with other validations
10 views
Skip to first unread message
Marcello 'Mereghost' Rocha
unread,
Jul 11, 2010, 11:07:00 AM7/11/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Machinist Users
In Machinist 2 how should I handle the following case: A model Person
has a SSN which is a structured number which can (and will) be
validated. Should I generate a number on the fly by creating a method
in the spec_helper (or even in the blueprint)?
Pete Yandell
unread,
Jul 11, 2010, 7:01:38 PM7/11/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Machinist Users
On Jul 12, 1:07 am, "Marcello 'Mereghost' Rocha"
A blueprint block is just regular Ruby code, so you can happily put
some logic in there to generate your SSN, or you can pull it out into
a method and call it from your blueprint.