|
|
@ -348,8 +348,9 @@ module Report::Controller |
|
|
|
# @param query An optional query added to the disjunction qualifiying reports to be returned. |
|
|
|
# @param query An optional query added to the disjunction qualifiying reports to be returned. |
|
|
|
def find_optional_report(query = '1=0') |
|
|
|
def find_optional_report(query = '1=0') |
|
|
|
if params[:id] |
|
|
|
if params[:id] |
|
|
|
@query = report_engine.find(params[:id].to_i, |
|
|
|
@query = report_engine |
|
|
|
conditions: ["#{is_public_sql} OR (#{user_key} = ?) OR (#{query})", current_user.id]) |
|
|
|
.where(["#{is_public_sql} OR (#{user_key} = ?) OR (#{query})", current_user.id]) |
|
|
|
|
|
|
|
.find(params[:id].to_i) |
|
|
|
@query.deserialize if @query |
|
|
|
@query.deserialize if @query |
|
|
|
end |
|
|
|
end |
|
|
|
rescue ActiveRecord::RecordNotFound |
|
|
|
rescue ActiveRecord::RecordNotFound |
|
|
|