Skip to content

Commit

Permalink
[DEMAD-374] Correcciones
Browse files Browse the repository at this point in the history
  • Loading branch information
vanessasotob committed Jun 3, 2022
1 parent 402c104 commit b75a3c1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions app/controllers/admin/legislation/questions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,13 @@ def statistics
@data_without[:totals] = users_uniq.count

District.all.order(name: :asc).each do |d|
aux_count = User.joins(:adress).where("adresses.district = ? and users.id in (?)", d.id.to_s, users_uniq).count
aux_count = User.joins(:adress).where("UPPER(adresses.district) = UPPER(?) OR adresses.district = ? and users.id in (?)",d.name, d.id.to_s, users_uniq).count
@data_district[:totals] = @data_district[:totals] + aux_count
@data_district[:options].push({name: d.name, responses: aux_count})
end

Borought.all.order(name: :asc).each do |d|
aux_count = User.joins(:adress).where("adresses.borought = ? and users.id in (?)", d.id.to_s, users_uniq).count
aux_count = User.joins(:adress).where("UPPER(adresses.borought) = UPPER(?) OR adresses.borought = ? and users.id in (?)",d.name, d.id.to_s, users_uniq).count
@data_borought[:totals] = @data_borought[:totals] + aux_count
@data_borought[:options].push({name: d.name, responses: aux_count})
end
Expand Down Expand Up @@ -358,13 +358,13 @@ def statistics_generic
@data_without[:totals] = users_uniq.count

District.all.order(name: :asc).each do |d|
aux_count = User.joins(:adress).where("adresses.district = ? and users.id in (?)", d.id.to_s, users_uniq).count
aux_count = User.joins(:adress).where("UPPER(adresses.district) = UPPER(?) OR adresses.district = ? and users.id in (?)",d.name, d.id.to_s, users_uniq).count
@data_district[:totals] = @data_district[:totals] + aux_count
@data_district[:options].push({name: d.name, responses: aux_count})
end

Borought.all.order(name: :asc).each do |d|
aux_count = User.joins(:adress).where("adresses.borought = ? and users.id in (?)", d.id.to_s, users_uniq).count
aux_count = User.joins(:adress).where("UPPER(adresses.borought) = UPPER(?) OR adresses.borought = ? and users.id in (?)",d.name, d.id.to_s, users_uniq).count
@data_borought[:totals] = @data_borought[:totals] + aux_count
@data_borought[:options].push({name: d.name, responses: aux_count})
end
Expand Down
8 changes: 6 additions & 2 deletions app/views/legislation/processes/debate.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@
</div>
</div>
<%end%>
<% elsif @process.debate_phase.started? and !@process.debate_phase.open? %>
<% elsif !@process.debate_phase.open? %>
<span class="callout notice alert">
<%=t("legislation.questions.not_phase")%>
<%=t("legislation.questions.not_started")%>
</span>
<% else %>
<span class="callout notice alert">
<%=t("legislation.questions.not_phase")%>
</span>
<% end %>
</div>
Expand Down
1 change: 1 addition & 0 deletions config/locales/es/legislation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ es:
others: Ecosistema
questions:
not_phase: No se puede realizar el cuestionario debido a que se ha terminado la fase de consulta
not_started: No se puede realizar el cuestionario debido a que aun no ha empezado la fase de consulta
generate_questions:
value_other: Otra respuesta
value_range: Respuesta de un rango
Expand Down

0 comments on commit b75a3c1

Please sign in to comment.