Skip to content

Commit

Permalink
Change how some events statistics are retrieved
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaCheca committed Apr 30, 2018
1 parent c6e0c5f commit ee5ad32
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/controllers/statistics_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ def index
@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
@event_lobby_activity = Event.where("lobby_activity").count
@events_count = Event.published.count
@event_lobby_activity = Event.where("lobby_activity", status: [1, 2]).count
@events_count = Event.where(status: [1, 2]).count
@holders_count = Holder.count
end

Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ en:
agents: "People registered to meet"
public_agendas: "About public agendas"
lobby_events: "Events wiht lobby activity"
total_events: "Total events"
total_events: "Total events (since December 28th, 2017)"
amount_public_agendas: "Total public agendas"
category: "Category"
interest: "Interest"
Expand Down
3 changes: 1 addition & 2 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,8 @@ es:
agents: "Personas inscritas para reunirse"
public_agendas: "Información relativa a las agendas públicas"
lobby_events: "Eventos con actividad de lobby"
total_events: "Total de eventos"
total_events: "Total de eventos (desde el 28 de diciembre de 2017)"
amount_public_agendas: "Total de agendas públicas"
category: "Categoría"
interest: "Interés"
amount: "Cantidad"

4 changes: 3 additions & 1 deletion spec/features/statistics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@
scenario 'Should show total amount of published events' do
create(:event)
create(:event, published_at: Date.tomorrow)
create(:event, published_at: Date.yesterday)
event3 = create(:event, published_at: Date.yesterday, status: :canceled)

event3.update(status: :canceled)

visit statistics_path

Expand Down

0 comments on commit ee5ad32

Please sign in to comment.