apparently exec_query fixes everything

This commit is contained in:
Ilion Beyst 2015-09-11 20:03:04 +02:00
parent 35ec93e161
commit 60b7a14a5d

View file

@ -16,13 +16,11 @@ class DataTable
end end
private private
def data def data
run_query(paginated_query.project(Arel.star)).map do |record| run_query(paginated_query.project(Arel.star))
record.reject! {|k,v| k.is_a? Numeric} # Remove unneeded query results
end
end end
def count def count
run_query(query.project(Arel.star.count)).first[0] run_query(query.project(Arel.star.count)).first["COUNT(*)"]
end end
def paginated_query def paginated_query
@ -64,7 +62,7 @@ class DataTable
end end
def run_query query def run_query query
ActiveRecord::Base.connection.execute(query.to_sql) ActiveRecord::Base.connection.exec_query(query.to_sql)
end end
def sanitize_params(params) def sanitize_params(params)