Validate presence of name on group
This commit is contained in:
parent
4cd46abaac
commit
b7d648e173
2 changed files with 2 additions and 1 deletions
|
|
@ -26,7 +26,7 @@ class PublicsController < ApplicationController
|
||||||
begin
|
begin
|
||||||
@user = Person.first(:id => params[:id]).owner
|
@user = Person.first(:id => params[:id]).owner
|
||||||
rescue NoMethodError => e
|
rescue NoMethodError => e
|
||||||
Rails.logger.error("Received post #{params[:xml]} for nonexistent person #{params[:id}")
|
Rails.logger.error("Received post #{params[:xml]} for nonexistent person #{params[:id]}")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
Rails.logger.debug "PublicsController has received: #{params[:xml]}"
|
Rails.logger.debug "PublicsController has received: #{params[:xml]}"
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ class Group
|
||||||
include MongoMapper::Document
|
include MongoMapper::Document
|
||||||
|
|
||||||
key :name, String
|
key :name, String
|
||||||
|
validates_presence_of :name
|
||||||
|
|
||||||
key :person_ids, Array
|
key :person_ids, Array
|
||||||
key :request_ids, Array
|
key :request_ids, Array
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue