Commit db4b209840f2ecd2f057d3c069d5b138cd94dfae

Authored by Thiago Ribeiro
2 parents 8ebcd93c 4f2a92fc
Exists in master and in 1 other branch stable

Merge branch 'change_members_page' into 'master'

Change members page

Some of the collaboration blocks are using the wrong url to its communities members page, this MR fix this.

See merge request !3
db/migrate/20150916134427_change_members_page_link_in_all_softwares_communities.rb 0 → 100644
... ... @@ -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 +
... ...