[Git][noosfero/noosfero][master] 2 commits: Allow other Profile types to use blocks

Marcos Ronaldo Pereira Junior gitlab at mg.gitlab.com
Tue Mar 29 15:02:15 BRT 2016


Marcos Ronaldo Pereira Junior pushed to branch master at Noosfero / noosfero


Commits:
44a3c877 by Marcos Ronaldo at 2016-03-29T13:56:22-03:00
Allow other Profile types to use blocks

Signed-off-by: Rodrigo Souto <rodrigo at colivre.coop.br>

- - - - -
cae1f9c6 by Marcos Ronaldo Pereira Junior at 2016-03-29T18:01:20+00:00
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
- - - - -


1 changed file:

- lib/noosfero/plugin.rb


Changes:

=====================================
lib/noosfero/plugin.rb
=====================================
--- a/lib/noosfero/plugin.rb
+++ b/lib/noosfero/plugin.rb
@@ -190,7 +190,7 @@ class Noosfero::Plugin
       type = type.map do |x|
         x.is_a?(String) ? x.capitalize.constantize : x
       end
-      raise "This is not a valid type" if !type.empty? && ![Person, Community, Enterprise, Environment].detect{|m| type.include?(m)}
+      raise "This is not a valid type" if !type.empty? && (type.any?{|t| !(t < Profile) && t != Environment })
 
       position = options[:position]
       position = position.is_a?(Array) ? position : [position].compact



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/723a60610bcf91ad1ef512e50a013c239a71f12f...cae1f9c64c28f511fefa79c5fbb26b51b8fb743b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160329/854daac2/attachment-0001.html>


More information about the Noosfero-dev mailing list