Sha256: 4a820f03f999d615ac4b21258471679ca25e279207e888ceb2fe109bb3bdfa07

Contents?: true

Size: 367 Bytes

Versions: 7

Compression:

Stored size: 367 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class BadgesCell < Decidim::ViewModel
    include Decidim::ApplicationHelper
    include Decidim::LayoutHelper
    include Decidim::Core::Engine.routes.url_helpers

    def available_badges
      Decidim::Gamification.badges.select do |badge|
        badge.valid_for?(model)
      end.sort_by(&:name)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-core-0.28.4 app/cells/decidim/badges_cell.rb
decidim-core-0.28.3 app/cells/decidim/badges_cell.rb
decidim-core-0.28.2 app/cells/decidim/badges_cell.rb
decidim-core-0.28.1 app/cells/decidim/badges_cell.rb
decidim-core-0.28.0 app/cells/decidim/badges_cell.rb
decidim-core-0.28.0.rc5 app/cells/decidim/badges_cell.rb
decidim-core-0.28.0.rc4 app/cells/decidim/badges_cell.rb