DEV: Resolve add_to_serializer deprecations (#243)

26b7f8a63b
This commit is contained in:
David Taylor 2023-04-24 15:45:36 +01:00 committed by GitHub
parent 3907c49263
commit 412333c25c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -1,3 +1,4 @@
3.1.0.beta3: 3907c4926383303ff85d992bb276e2b173cf0843
3.1.0.beta1: 0f6b30c2d84d44978be1c845267609446ca9dbf2 3.1.0.beta1: 0f6b30c2d84d44978be1c845267609446ca9dbf2
2.9.0.beta8: 729e5a2add46fb4e2d8ed092da05a87ebbfcf05b 2.9.0.beta8: 729e5a2add46fb4e2d8ed092da05a87ebbfcf05b
2.9.0.beta6: 272e9dd760f82e33f9756866434ddcbe470cdb8e 2.9.0.beta6: 272e9dd760f82e33f9756866434ddcbe470cdb8e

View File

@ -64,13 +64,11 @@ after_initialize do
user_is_a_member_of_group?(group) && query.groups.exists?(id: group.id) user_is_a_member_of_group?(group) && query.groups.exists?(id: group.id)
end end
add_to_serializer(:group_show, :has_visible_data_explorer_queries, false) do add_to_serializer(
DiscourseDataExplorer::Query.for_group(object).exists? :group_show,
end :has_visible_data_explorer_queries,
include_condition: -> { scope.user_is_a_member_of_group?(object) },
add_to_serializer(:group_show, :include_has_visible_data_explorer_queries?, false) do ) { DiscourseDataExplorer::Query.for_group(object).exists? }
SiteSetting.data_explorer_enabled && scope.user_is_a_member_of_group?(object)
end
register_bookmarkable(DiscourseDataExplorer::QueryGroupBookmarkable) register_bookmarkable(DiscourseDataExplorer::QueryGroupBookmarkable)