diff --git a/.discourse-compatibility b/.discourse-compatibility index 00ddc59..dc6dd51 100644 --- a/.discourse-compatibility +++ b/.discourse-compatibility @@ -1,3 +1,4 @@ +3.1.0.beta3: 3907c4926383303ff85d992bb276e2b173cf0843 3.1.0.beta1: 0f6b30c2d84d44978be1c845267609446ca9dbf2 2.9.0.beta8: 729e5a2add46fb4e2d8ed092da05a87ebbfcf05b 2.9.0.beta6: 272e9dd760f82e33f9756866434ddcbe470cdb8e diff --git a/plugin.rb b/plugin.rb index beec18c..c4b0a82 100644 --- a/plugin.rb +++ b/plugin.rb @@ -64,13 +64,11 @@ after_initialize do user_is_a_member_of_group?(group) && query.groups.exists?(id: group.id) end - add_to_serializer(:group_show, :has_visible_data_explorer_queries, false) do - DiscourseDataExplorer::Query.for_group(object).exists? - end - - add_to_serializer(:group_show, :include_has_visible_data_explorer_queries?, false) do - SiteSetting.data_explorer_enabled && scope.user_is_a_member_of_group?(object) - end + add_to_serializer( + :group_show, + :has_visible_data_explorer_queries, + include_condition: -> { scope.user_is_a_member_of_group?(object) }, + ) { DiscourseDataExplorer::Query.for_group(object).exists? } register_bookmarkable(DiscourseDataExplorer::QueryGroupBookmarkable)