Commit 44a3c8774f608f9a0a2101d4811680647a5e4bcd
1 parent
723a6061
Exists in
web_steps_improvements
and in
8 other branches
Allow other Profile types to use blocks
Signed-off-by: Rodrigo Souto <rodrigo@colivre.coop.br>
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
lib/noosfero/plugin.rb
@@ -190,7 +190,7 @@ class Noosfero::Plugin | @@ -190,7 +190,7 @@ class Noosfero::Plugin | ||
190 | type = type.map do |x| | 190 | type = type.map do |x| |
191 | x.is_a?(String) ? x.capitalize.constantize : x | 191 | x.is_a?(String) ? x.capitalize.constantize : x |
192 | end | 192 | end |
193 | - raise "This is not a valid type" if !type.empty? && ![Person, Community, Enterprise, Environment].detect{|m| type.include?(m)} | 193 | + raise "This is not a valid type" if !type.empty? && (type.any?{|t| !(t < Profile) && t != Environment }) |
194 | 194 | ||
195 | position = options[:position] | 195 | position = options[:position] |
196 | position = position.is_a?(Array) ? position : [position].compact | 196 | position = position.is_a?(Array) ? position : [position].compact |