Skip to content

Commit 2c5c210

Browse files
committed
Merge pull request riseuplabs#84 from azul/bugfix/group_pages
class Tag now is ActsAsTaggableOn::Tag - fixes #8308
2 parents a0ad807 + 814f457 commit 2c5c210

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

app/models/page_extension/groups.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def month_counts(options)
128128
#
129129
def tags_for_group(group, current_user)
130130
filter = access_filter(group: group, current_user: current_user)
131-
Tag.find_by_sql(%Q[
131+
ActsAsTaggableOn::Tag.find_by_sql(%Q[
132132
SELECT tags.*, count(name) as count
133133
FROM tags
134134
INNER JOIN taggings ON tags.id = taggings.tag_id AND taggings.taggable_type = 'Page'

test/functional/groups/home_controller_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require File.dirname(__FILE__) + '/../../test_helper'
1+
require 'test_helper'
22

33
class Groups::HomeControllerTest < ActionController::TestCase
44

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'test_helper'
2+
3+
class Groups::PagesControllerTest < ActionController::TestCase
4+
fixtures :all
5+
6+
def test_index
7+
user = users(:penguin)
8+
group = groups(:rainbow)
9+
login_as user
10+
assert_permission :may_show_group? do
11+
get :index, group_id: group
12+
end
13+
assert_response :success
14+
assert assigns('pages').any?
15+
assert assigns('pages').all?{|p| p.public? || user.may?(:view, p)}
16+
end
17+
end

0 commit comments

Comments
 (0)