Commit 4f2a92fcfd5df641956aaa4f8202ef1ad41ac450
1 parent
8ebcd93c
Exists in
master
and in
1 other branch
Puts all softwares communities collaboration block to use the correct members page link
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Showing
1 changed file
with
24 additions
and
0 deletions
Show diff stats
db/migrate/20150916134427_change_members_page_link_in_all_softwares_communities.rb
0 → 100644
@@ -0,0 +1,24 @@ | @@ -0,0 +1,24 @@ | ||
1 | +# encoding: utf-8 | ||
2 | + | ||
3 | +class ChangeMembersPageLinkInAllSoftwaresCommunities < ActiveRecord::Migration | ||
4 | + def up | ||
5 | + Community.joins(:software_info).each do |software_community| | ||
6 | + collaboration_block = Block.joins(:box).where("boxes.owner_id = ? AND blocks.type = ? AND blocks.title = ?", software_community.id, "LinkListBlock", "Colaboração").readonly(false).first | ||
7 | + | ||
8 | + if collaboration_block | ||
9 | + collaboration_block.links.each do |link| | ||
10 | + link["address"] = "/profile/#{software_community.identifier}/members" if link["name"] == "Usuários" | ||
11 | + end | ||
12 | + collaboration_block.save! | ||
13 | + print "." | ||
14 | + end | ||
15 | + end | ||
16 | + | ||
17 | + puts "" | ||
18 | + end | ||
19 | + | ||
20 | + def down | ||
21 | + say "This can't be reverted" | ||
22 | + end | ||
23 | +end | ||
24 | + |