From 004e659ee1d9a814ffeb5f05186da2592e4189ea Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 15:10:49 -0700 Subject: [PATCH] fix album posting --- app/models/user.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index c6957ff6d..272f404bc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -128,14 +128,18 @@ class User end def validate_aspect_permissions(aspect_ids) - aspect_ids = [aspect_ids.to_s] if aspect_ids.is_a? BSON::ObjectId + if aspect_ids == "all" + return aspect_ids + end + + aspect_ids = [aspect_ids.to_s] unless aspect_ids.is_a? Array if aspect_ids.nil? || aspect_ids.empty? raise ArgumentError.new("You must post to someone.") end aspect_ids.each do |aspect_id| - unless aspect_id == "all" || self.aspects.find(aspect_id) + unless self.aspects.find(aspect_id) raise ArgumentError.new("Cannot post to an aspect you do not own.") end end