apparently exec_query fixes everything
This commit is contained in:
parent
35ec93e161
commit
60b7a14a5d
1 changed files with 3 additions and 5 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue