Commit cae1f9c64c28f511fefa79c5fbb26b51b8fb743b

Authored by Marcos Pereira
2 parents 723a6061 44a3c877

Merge branch 'master' into 'master'

Allow other Profile types to use blocks

Allow other Profile types (besides Person, Community and Enterprise) to use blocks

See merge request !742
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