Commit 27ef9853f4822acef608a2908feb895e90fea4bb
1 parent
895776ac
Exists in
master
and in
29 other branches
Don't duplicate themes
Showing
3 changed files
with
11 additions
and
1 deletions
Show diff stats
app/controllers/my_profile/themes_controller.rb
| ... | ... | @@ -14,7 +14,7 @@ class ThemesController < MyProfileController |
| 14 | 14 | end |
| 15 | 15 | |
| 16 | 16 | def index |
| 17 | - @themes = profile.environment.themes + Theme.approved_themes(profile) | |
| 17 | + @themes = (profile.environment.themes + Theme.approved_themes(profile)).uniq_by{ |t| t.id } | |
| 18 | 18 | @current_theme = profile.theme |
| 19 | 19 | |
| 20 | 20 | @layout_templates = LayoutTemplate.all | ... | ... |
lib/noosfero/core_ext.rb