Require auth on calls to /trace/create, and pass through to form if called without params. Adjust validations on traces to prevent dual error messages on description (validates_presence_of catches the empty string removed from length validation)
More changes to come for api_create References #1510
This commit is contained in:
parent
d3dc973376
commit
9bb9de0fbe
2 changed files with 23 additions and 21 deletions
|
@ -3,8 +3,8 @@ class Trace < ActiveRecord::Base
|
|||
|
||||
validates_presence_of :user_id, :name, :timestamp
|
||||
validates_presence_of :description, :on => :create
|
||||
validates_length_of :name, :within => 1..255
|
||||
validates_length_of :description, :within => 1..255
|
||||
validates_length_of :name, :maximum => 255
|
||||
validates_length_of :description, :maximum => 255
|
||||
# validates_numericality_of :latitude, :longitude
|
||||
validates_inclusion_of :public, :inserted, :in => [ true, false]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue