[Git][noosfero/noosfero][master] 2 commits: Fixes plugin controller routes ordering

Rodrigo Souto gitlab at mg.gitlab.com
Tue Dec 12 12:26:57 BRST 2017


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
7088835b by Gabriel Silva at 2017-12-08T11:04:23-02:00
Fixes plugin controller routes ordering

Signed-off-by: Gabriel Silva <gabriel93.silva at gmail.com>

- - - - -
f93ac488 by Rodrigo Souto at 2017-12-12T14:26:46+00:00
Merge branch 'plugin_routes_order' into 'master'

Fixes plugin controller routes ordering

See merge request noosfero/noosfero!1358
- - - - -


1 changed file:

- config/routes/50_plugins.rb


Changes:

=====================================
config/routes/50_plugins.rb
=====================================
--- a/config/routes/50_plugins.rb
+++ b/config/routes/50_plugins.rb
@@ -16,6 +16,12 @@ Dir.glob Rails.root.join plugins_root, '*', 'controllers' do |controllers_dir|
     hash[folder] = Dir.glob("#{path}{*.rb,#{plugin_name}_plugin/*.rb}").map do |filename|
       filename.gsub(path, '').gsub(/[_\/]controller.rb$/, '')
     end
+
+    # Pushes the default plugin controller to the end of the list, otherwise
+    # it might obfuscate the routes that are listed after it.
+    plugin_controller = hash[folder].delete("#{plugin_name}_plugin")
+    hash[folder].push(plugin_controller) if plugin_controller.present?
+
     hash
   end
 



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/a29f49568516ec210a931cd83d4eeed4e77d956e...f93ac488c16b64a45679cc81ef860c01fd61cd51

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/a29f49568516ec210a931cd83d4eeed4e77d956e...f93ac488c16b64a45679cc81ef860c01fd61cd51
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20171212/7cb79493/attachment.html>


More information about the Noosfero-dev mailing list