<commit_before># frozen_string_literal: true

module Decidim
  module Meetings
    module ContentBlocks
      class HighlightedMeetingsCell < Decidim::ContentBlocks::HighlightedElementsCell
        def base_relation
          Decidim::Meetings::Meeting.except_withdrawn.where(component: published_components)
        end

        def elements
          @elements ||= base_relation.order(start_time: :asc).limit(limit)
        end

        def geolocation_enabled?
          Decidim::Map.available?(:geocoding)
        end

        private

        def limit
          geolocation_enabled? ? 4 : 8
        end
      end
    end
  end
end
<commit_msg>Fix displaying hidden meetings in processes group's "upcoming meetings" content block (#8818)<commit_after># frozen_string_literal: true

module Decidim
  module Meetings
    module ContentBlocks
      class HighlightedMeetingsCell < Decidim::ContentBlocks::HighlightedElementsCell
        def base_relation
          Decidim::Meetings::Meeting
            .except_withdrawn
            .published
            .not_hidden
            .upcoming
            .visible_meeting_for(current_user)
            .where(component: published_components)
        end

        def elements
          @elements ||= base_relation.order(start_time: :asc).limit(limit)
        end

        def geolocation_enabled?
          Decidim::Map.available?(:geocoding)
        end

        private

        def limit
          geolocation_enabled? ? 4 : 8
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.06315789473684211, 'fraction_numerical': 0.005263157894736842, 'mean_word_length': 2.2361702127659573, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '144256', 'n_tokens_mistral': 433, 'n_tokens_neox': 406, 'n_words': 93}