Skip to content

Commit

Permalink
Merge ece063a into c6e0c5f
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaCheca committed Apr 26, 2018
2 parents c6e0c5f + ece063a commit b51cbfe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/statistics_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class StatisticsController < ApplicationController

def index
@lobbies_categories = Category.all.map { |c| [c.name, c.organizations.lobby.count] }.to_h
@lobbies_categories = Category.visible.map { |c| [c.name, c.organizations.lobby.count] }.to_h
@lobbies_interests = Interest.all.map { |i| [i.name, i.organizations.lobby.count] }.to_h
@lobbies = Organization.lobby.active
@active_agent_count = Agent.active.from_active_organizations.count
Expand Down
2 changes: 2 additions & 0 deletions app/models/category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ class Category < ActiveRecord::Base

has_many :organizations, dependent: :destroy

scope :visible, -> { where(display: true) }

end

0 comments on commit b51cbfe

Please sign in to comment.