Class: TagGroupSerializer
Instance Method Summary
collapse
expire_cache_fragment!, fragment_cache
#include!
Instance Method Details
#parent_tag_name ⇒ Object
10
11
12
|
# File 'app/serializers/tag_group_serializer.rb', line 10
def parent_tag_name
[object.parent_tag.try(:name)].compact
end
|
#permissions ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'app/serializers/tag_group_serializer.rb', line 14
def permissions
@permissions ||=
begin
h = {}
object
.tag_group_permissions
.joins(:group)
.includes(:group)
.find_each do |tgp|
name = Group::AUTO_GROUP_IDS.fetch(tgp.group_id, tgp.group.name).to_s
h[name] = tgp.permission_type
end
h["everyone"] = TagGroupPermission.permission_types[:full] if h.empty?
h
end
end
|
#tag_names ⇒ Object
6
7
8
|
# File 'app/serializers/tag_group_serializer.rb', line 6
def tag_names
object.tags.base_tags.map(&:name).sort
end
|