Skip to content

Commit 50cc31e

Browse files
committed
search now working
1 parent 0913533 commit 50cc31e

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

app/controllers/pages_controller.rb

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def search
4141
if params[:desde] != nil and params[:desde] != "" and params[:hasta] != nil and params[:hasta] != ""
4242
print("DESDE Y HASTA")
4343
if current_user.prosecutor.present?
44+
print("Dentro de presecutor desde")
4445
x = Procedure.where("DATE(created_at) > ? AND DATE(created_at) < ? and local_prosecution_in_charge_id=?", params[:desde], params[:hasta], current_user.prosecutor.local_prosecution_id).pluck(:id)
4546
elsif current_user.police_unit.present?
4647
x = Procedure.where("DATE(created_at) > ? AND DATE(created_at) < ? and police_unit_in_charge_id=?", params[:desde], params[:hasta], current_user.police_unit_id).pluck(:id)
@@ -171,11 +172,10 @@ def search
171172
end
172173

173174
@marcas = []
174-
if params[:tag_ids] != nil and params[:tag_ids] != ""
175+
if params[:tag_ids] != nil and params[:tag_ids] != [""]
175176
for tag_name in params[:tag_ids][1..params[:tag_ids].size]
176177
@marcas.push(Procedure.find(Tagging.where("tag_id = ?",Tag.where("name = ?", tag_name).pluck(:id)).pluck(:procedure_id)).pluck(:id))
177178
end
178-
print("TEEEEEEEEEEEEEEEEEEEEEESTTTTTTTTTTTTTTTT",@marcas)
179179
x = []
180180
for i in @marcas
181181
for w in i
@@ -193,13 +193,6 @@ def search
193193
else
194194
@marcas = [-1]
195195
end
196-
puts(@palabras_clave)
197-
puts(@desde)
198-
puts(@clasificacion)
199-
puts(@involucra_fallecidos)
200-
puts(@delito)
201-
puts(@query)
202-
puts(@marcas)
203196
@fin = [-2]
204197
[@query, @palabras_clave, @desde, @clasificacion, @involucra_fallecidos, @delito, @marcas].each do |list|
205198
if list != [-1]

app/models/procedure.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ class Procedure < ApplicationRecord
1717
validate :past_date
1818
validate :empty_address
1919

20-
validates :photos, file_size: { less_than_or_equal_to: 500.kilobytes },
20+
validates :photos, file_size: { less_than_or_equal_to: 50.megabytes },
2121
file_content_type: { allow: ['image/jpeg', 'image/png', 'image/jpg', 'image/bmp'] }
2222

2323
validates :videos, file_size: { less_than_or_equal_to: 1.gigabytes },
2424
file_content_type: { allow: ['video/mp4']}
2525

26-
validates :documents,file_size: { less_than_or_equal_to: 5.megabytes},
26+
validates :documents,file_size: { less_than_or_equal_to: 50.megabytes},
2727
file_content_type: { allow: [ 'application/pdf', 'text/plain'] }
2828

2929
enum state: {open: 0, close: 1, draft: 2}

app/views/procedures/new.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div id="general" class="card-body">
1111
<div id="datetime" class="mb-3 d-flex justify-content-between">
1212
<div class="form-inline">
13-
<%= form.label :date, 'Fecha: ', class: "mr-2 form-label"%>
13+
<%= form.label :date, 'Fecha de procedimiento: ', class: "mr-2 form-label"%>
1414
<div>
1515
<%= form.date_field :date , class: "form-control"%>
1616
<div id="form-invalid-date" class="invalid-feedback" hidden></div>

0 commit comments

Comments
 (0)