Proyecto

General

Perfil

Acciones

Correcciones y mejoras #2879

cerrada

Error na sintesi dos recursos o seleccionar tipo de açao

Añadido por Jaime Ortiz hace más de 9 años. Actualizado hace más de 7 años.

Estado:
Resuelta
Prioridad:
Normal
Asignado a:
Versión prevista:
Fecha de inicio:
2015-05-20
Fecha fin:
% Realizado:

100%

Tiempo estimado:

Descripción

ActiveRecord::StatementInvalid in SummaryController#resources
Mysql2::Error: Unknown column 'subact_types.act_type_id' in 'where clause': SELECT SUM(number * supplies.price_per_unit) AS sum_number_all_supplies_price_per_unit, land_id AS land_id, subacts.subact_type_id AS subacts_subact_type_id FROM supplies INNER JOIN supply_types ON supply_types.id = supplies.supply_type_id INNER JOIN subacts ON subacts.id = supplies.subact_id INNER JOIN acts ON acts.id = subacts.act_id INNER JOIN areas ON areas.id = acts.area_id WHERE supplies.supply_type_id IN (SELECT supply_types.id FROM supply_types WHERE supply_types.subact_type_id IN (SELECT subact_types.id FROM subact_types WHERE subact_types.act_type_id = '2')) GROUP BY land_id, subacts.subact_type_id

Extracted source (around line #148):
146
147
148
149
150
151

# Filter by type (cost or quantity)
if session[:filter][:type] == "1"
  @subacts = Supply.joins(:supply_type, subact: {act: :area}).where(act_type_filter).where(year_filter).group(:land_id, "subacts.subact_type_id").sum("number * supplies.price_per_unit")
  @supplies = Supply.joins(:supply_type, subact: {act: :area}).where(act_type_filter).where(year_filter).group(:land_id, :supply_type_id).sum("number * supplies.price_per_unit")
else
  @subacts = nil

Rails.root: /Users/jaime/sociambiental

Application Trace | Framework Trace | Full Trace
app/controllers/summary_controller.rb:148:in `resources'
Request

Parameters:

None
Toggle session dump
Toggle env dump
Response

Headers:

None

Acciones

Exportar a: Atom PDF