noosfero | Applied SOLID principles (!1267)

Rodrigo Souto gitlab at mg.gitlab.com
Tue Jul 4 16:17:44 BRT 2017


Hi @tiagorc. This code as it is, is good to go as a refactoring code. But it touches a code that is kind of obsolete. The method `search_article_privacy_exceptions` uses a `LIKE` search but in those cases we should use the `find_by_contents` method which is much more efficient and integrated with search engines. Do you want to try fixing this as well? I'm listing here some files with very similar code using `find_by_contents` instead in case you want to include this in your refactoring. 

* `app/controllers/public/invite_controller.rb` - `InviteController#search`
* `app/controllers/public/profile_controller.rb` - `ProfileController#search_followed`
* `app/controllers/my_profile/profile_roles_controller.rb` - `ProfileRolesController#assign_role_by_members`

If you want to go even further, look for other `LIKE` search queries and replace them as well. That would be a great contribution to Noosfero.

---
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1267#note_34183408
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/20170704/d33796e9/attachment.html>


More information about the Noosfero-dev mailing list