Validation is missing in generated crud

Bug #511027 reported by Matt Jones
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rootin Tootin
Fix Released
Medium
Unassigned

Bug Description

When you create a generated crud app, there is no validation. It should do something to show you how to validate at least.

Matt Jones (workhorsy)
Changed in rester:
importance: Low → Medium
Revision history for this message
Matt Jones (workhorsy) wrote :

Validation should be added via the gen scaffolding:

./gen create scaffold note name:string validates uniqueness_of:name
./gen create scaffold item price:decimal[10,2] validates presence_of:price

Other validations from rails:
validates_acceptance_of
validates_associated
validates_confirmation_of
validates_each
validates_exclusion_of
validates_format_of
validates_inclusion_of
validates_length_of
validates_numericality_of
validates_presence_of
validates_size_of
validates_uniqueness_of

Revision history for this message
Matt Jones (workhorsy) wrote :

For now, we will just add the 2 most useful validations:

validates_presence_of
validates_uniqueness_of

Revision history for this message
Matt Jones (workhorsy) wrote :

validate presence of can be used like:

./gen create scaffold note title:string name:string content:text validates presence_of:title,name

Matt Jones (workhorsy)
Changed in rester:
status: Confirmed → Fix Committed
Matt Jones (workhorsy)
Changed in rester:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.